/** * Create an instance of {@link Detail } * */ public Detail createDetail() { return new Detail(); }
public static Detail newInstance(String time) { Detail fragment = new Detail(); Bundle args = new Bundle(); args.putString("time", time); fragment.setArguments(args); return fragment; }
oldDetails.put(new Detail(text,oldHeaderId)); oldDetails.moveToNext(); cv.put("text",detail.getText()); cv.put("id", idMap.get(detail.getHeaderId())); //retrieving the new _id based on the old db.insert("Details", null, cv);
Product p1 = new Product("the container"); Product p2 = new Product("the product"); Detail d = new Detail(); d.setProduct(p2); p1.getDetails().add(d); session.save(p2); session.save(p1);
public class MasterDetailResultSetExtractor implements ResultSetExtractor { @Override public Object extractData(ResultSet rs) throws SQLException { Master m = new Master(); m.setFirstName(rs.getString(1)); m.setLastName(rs.getString(2)); //put the master in a map Detail d = new Detail(); d.setSomeProp(rs.getString(3)); //check if the master is in the map //if yes - add the detail to the master //if no - add the master first return m; } }
@WebMethod(operationName = "SoapFault", action = "http://www.w3.org/2005/08/addressing/soap/fault") @Oneway @Action(input="http://www.w3.org/2005/08/addressing/soap/fault") public void soapFault( @WebParam(name = "Fault", targetNamespace = "http://schemas.xmlsoap.org/soap/envelope/", partName = "fault") Fault fault) { MessageContext ctx = webServiceCtx.getMessageContext(); MAP inboundMap = AddressingHelper.inboundMap(ctx); if (inboundMap.getRelatesTo() != null) { WSCLogger.logger.tracev("CoordinationFaultPortTypeImpl receiving fault for message={0} - string={1} code={2} details={3}", inboundMap.getRelatesTo().getRelatesTo(), fault.getFaultstring(), fault.getFaultcode(), fault.getDetail() == null? "null" : fault.getDetail().getAny()); AsynchronousRegistrationMapper.getInstance().assignFault(inboundMap.getRelatesTo().getRelatesTo(), fault); } else { WSCLogger.i18NLogger.error_empty_messageId_received_by_async_endpoint(); } }
/** * Create an instance of {@link Detail } * */ public Detail createDetail() { return new Detail(); }
/** * Create an instance of {@link Detail } * */ public Detail createDetail() { return new Detail(); }
/** * Create an instance of {@link Detail } * */ public Detail createDetail() { return new Detail(); }
List<Detail> allDetails = new LinkedList<Detail>(); while(rs.next()) { String a = rs.getString("weight"); String b = rs.getString("note_state"); String c = rs.getString("dm_state"); allDetail.add(new Detail (a, b, c)); }
String jsondata = loadJSONFromAsset();//load data and assign as json string JSONArray primaryArray; try { primaryArray = new JSONArray(jsondata); for (int i = 0; i < primaryArray.length(); i++) { JSONObject jObject = primaryArray.getJSONObject(i); String description = (String) jObject.getString("Description"); Log.d("Description", description); Double latitude = jObject.getDouble("Latitude"); Log.d("Latitude", latitude+""); Double longitude = jObject.getDouble("Longitude"); Log.d("Longitude", longitude+""); detailList.add(new Detail(description, latitude, longitude)); } } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); }
List<Detail> detailList = new ArrayList<>(); JSONArray journeys = new JSONObject(""); for(int i = 0 ; i < journeys.length() ; i++) { // Traverse journeys JSONObject journey = journeys.getJSONObject(i); // get journeys(i) -> journey if(journey.has("legs")) { // if journey has "legs" key JSONArray legs = journey.getJSONArray("legs"); // get the legs array from journey object for(int j = 0 ; j < legs.length() ; j++) { // Traverse legs JSONObject leg = legs.getJSONObject(j); // get legs(j) -> leg if(leg.has("instruction")) { // if leg has "instruction" key in it JSONObject instruction = leg.getJSONObject("instruction"); // get instruction jsonObject String journeyType = journey.getString("$type"); String legType = leg.getString("$type"); String instructionType = instruction.getString("$type"); String detailed = instruction.getString("detailed"); // get detailed string in instruction object detailList.add(new Detail(journeyType, legType, instructionType, detailed)); } } } } for(Detail detail : detailList) { TextView textView = new TextView([yourContext]); textView.setText(detail.detail); yourContentViewGroup.addView(textView); // or you can use View.inflate(context, layoutRes, yourContentViewGroup) and design a layout to show other detail instance values }
public Fragment getItem(int position) { return new Detail("I'm a detail!");
detail = new Detail();