Address a = new Address(); a.phone="001-555-12345";
JSONObject result = results.getJSONObject(i); String indiStr = result.getString("formatted_address"); Address addr = new Address(Locale.getDefault()); addr.setAddressLine(0, indiStr); retList.add(addr);
int port = socket.getLocalPort(); CopycatServer server = CopycatServer .builder(new Address(NetworkAddressUtils.getConnectHost(ServiceType.MASTER_RAFT, ServerConfiguration.global()), port)) .withSnapshotAllowed(new AtomicBoolean(false)) .withTransport(new NettyTransport()) .withSerializer(RaftJournalSystem.createSerializer()) .withType(Type.PASSIVE) server.join(RaftJournalConfiguration.defaults(serviceType) .getClusterAddresses().stream() .map(addr -> new Address(addr.getHostName(), addr.getPort())) .collect(Collectors.toList())); while (lastUpdate.get() < 0
Employee objEmployee = (Employee) session.get(Employee.class, 1); Address objAdd = new Address(); objAdd.setId(200); objAdd.setCity("Mumbai"); objAdd.setState("Maharashtra"); objAdd.setObjEmployee(objEmployee); //objEmployee.getLstAddress().add(objAdd); // save objAdd not objEmployee session.saveOrUpdate(objAdd);
@Override public int hashCode() { return serverAddress.hashCode(); }
@Override public Server server() { return remote.server(); } }
Person p = new Person() {{ setFirstName("John"); setLastName("Doe"); setAddress(new Address() {{ setStreet("1234 St."); setCity("Phoenix"); }}); }};
@Override public int id() { return serverAddress.hashCode(); }
private static Address getLocalAddress(RaftJournalConfiguration conf) { return new Address(conf.getLocalAddress().getHostName(), conf.getLocalAddress().getPort()); }
@Override public int id() { return serverAddress.hashCode(); }
private static List<Address> getClusterAddresses(RaftJournalConfiguration conf) { return conf.getClusterAddresses().stream() .map(addr -> new Address(addr.getHostName(), addr.getPort())) .collect(Collectors.toList()); }
public class Tester { public static void main(String [] args) throws Exception { // Make a service AddressBookService service = new AddressBookServiceLocator(); // Now use the service to get a stub which implements the SDI. AddressBook port = service.getAddressBook(); // Make the actual call Address address = new Address(...); port.addEntry("Russell Butek", address); } }
import java.util.*; import javax.xml.bind.*; import org.eclipse.persistence.jaxb.JAXBContextProperties; import org.eclipse.persistence.sessions.SessionEventListener; public class Demo { public static void main(String[] args) throws Exception { Map<String, Object> properties = new HashMap<String, Object>(1); SessionEventListener sessionEventListener = new NullPolicySessionEventListener(); properties.put(JAXBContextProperties.SESSION_EVENT_LISTENER, sessionEventListener); JAXBContext jc = JAXBContext.newInstance(new Class[] {Address.class}, properties); Address address = new Address(); Marshaller marshaller = jc.createMarshaller(); marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); marshaller.marshal(address, System.out); } }
import javax.xml.bind.*; import javax.xml.stream.*; public class Demo { public static void main(String[] args) throws Exception { JAXBContext jc = JAXBContext.newInstance(Customer.class); Address address = new Address("123 A Street"); Customer customer = new Customer("Jane", address); XMLOutputFactory xof = XMLOutputFactory.newFactory(); XMLStreamWriter xsw = xof.createXMLStreamWriter(System.out); Marshaller marshaller = jc.createMarshaller(); marshaller.setListener(new MyMarshallerListener(xsw)); marshaller.marshal(customer, xsw); xsw.close();; } }
public printAddress(Address address) {...} Address address = new Address(); address.setName(name); address.setStreet(street); address.setCity(city); printAddress(address);
/** * Returns the next server address. * * @return The next server address. */ private Address nextAddress() { return new Address("localhost", port++); }
class TestAddress { public static void main(String[] args) { Address a = new Address(); a.phone="001-555-12345"; // won't compile since it's not within Address class } }