本文整理了Java中io.atomix.catalyst.transport.Address.<init>()
方法的一些代码示例,展示了Address.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Address.<init>()
方法的具体详情如下:
包路径:io.atomix.catalyst.transport.Address
类名称:Address
方法名:<init>
暂无
代码示例来源:origin: stackoverflow.com
Address a = new Address();
a.phone="001-555-12345";
代码示例来源:origin: Alluxio/alluxio
private static List<Address> getClusterAddresses(RaftJournalConfiguration conf) {
return conf.getClusterAddresses().stream()
.map(addr -> new Address(addr.getHostName(), addr.getPort()))
.collect(Collectors.toList());
}
代码示例来源:origin: stackoverflow.com
Person p = new Person()
{{
setFirstName("John");
setLastName("Doe");
setAddress(new Address()
{{
setStreet("1234 St.");
setCity("Phoenix");
}});
}};
代码示例来源:origin: Alluxio/alluxio
private static Address getLocalAddress(RaftJournalConfiguration conf) {
return new Address(conf.getLocalAddress().getHostName(), conf.getLocalAddress().getPort());
}
代码示例来源:origin: stackoverflow.com
JSONObject result = results.getJSONObject(i);
String indiStr = result.getString("formatted_address");
Address addr = new Address(Locale.getDefault());
addr.setAddressLine(0, indiStr);
retList.add(addr);
代码示例来源:origin: Alluxio/alluxio
int port = socket.getLocalPort();
CopycatServer server = CopycatServer
.builder(new Address(NetworkAddressUtils.getConnectHost(ServiceType.MASTER_RAFT,
ServerConfiguration.global()),
port))
server.join(RaftJournalConfiguration.defaults(serviceType)
.getClusterAddresses().stream()
.map(addr -> new Address(addr.getHostName(), addr.getPort()))
.collect(Collectors.toList()));
while (lastUpdate.get() < 0
代码示例来源:origin: stackoverflow.com
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);
}
}
代码示例来源:origin: stackoverflow.com
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);
}
}
代码示例来源:origin: stackoverflow.com
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();;
}
}
代码示例来源:origin: stackoverflow.com
Person()
{
this.name = "lary";
this.unitedStates = new Address();
this.unitedKingdom = new Address();
}
Person(String n)
{
this.name = n;
this.unitedStates = new Address("myStreet", "myCountry");
this.unitedKingdom = new Address();
}
代码示例来源:origin: atomix/copycat
/**
* Returns the next server address.
*
* @param type The startup member type.
* @return The next server address.
*/
private Member nextMember(Member.Type type) {
return new TestMember(type, new Address("localhost", ++port), new Address("localhost", port + 1000));
}
代码示例来源:origin: atomix/copycat
/**
* Returns a new Copycat server builder using the default host:port.
* <p>
* The server will be constructed at 0.0.0.0:8700.
*
* @return The server builder.
*/
public static Builder builder() {
return builder(new Address(DEFAULT_HOST, DEFAULT_PORT));
}
代码示例来源:origin: stackoverflow.com
Address someAddress = new Address();
someAddress.setCity(aCity);
someAddress.setState(aState);
Bank bank = new Bank();
bank.setBankAddress(someAddress);
...
public void setBankAddress(Address aBankAddress) {
bankAddress = aBankAddress;
}
代码示例来源:origin: stackoverflow.com
Address address1 = new Address("07093", "Brooklyn", "129 67th st", null, "USA");
Address address2 = new Address("03333", "Qeeens", "333 67th st", null, "USA");
address1 = addressRepository.save(address1);
address2 = addressRepository.save(address2);
// save a couple of customers
Customer jack = new Customer("Jack", "Bauer");
jack.setHomeAddress(address1);
repository.save(jack);
repository.save(new Customer("Chloe", "O'Brian",address1));
代码示例来源:origin: atomix/copycat
/**
* Returns the next server address.
*
* @param type The startup member type.
* @return The next server address.
*/
private Member nextMember(Member.Type type) {
return new TestMember(type, new Address("localhost", ++port), new Address("localhost", port + 1000));
}
代码示例来源:origin: stackoverflow.com
@Rule
public ExpectedException exception = ExpectedException.none();
@Test
public void testToString() throws IllegalCustomerIDException {
System.out.println("toString");
exception.expect(IllegalCustomerIDException.class);
exception.expectMessage("unkwon customer id 4711");
Address add = new Address("Blackthorn","Kings Lynn","PE30");
BusinessOrganisationDetails instance = new BusinessOrganisationDetails("PEA-1234",
"Smith",add,10,"EA",12);
}
代码示例来源:origin: atomix/copycat
/**
* Creates a collection of member addresses.
*/
private List<Member> createMembers(int nodes) {
List<Member> members = new ArrayList<>();
for (int i = 0; i < nodes; i++) {
members.add(new ServerMember(Member.Type.ACTIVE, new Address("localhost", 5000 + i), new Address("localhost", 6000 + i), Instant.now()));
}
return members;
}
代码示例来源:origin: atomix/copycat
/**
* Tests member getters.
*/
public void testMemberGetters() {
Instant instant = Instant.now();
ServerMember member = new ServerMember(Member.Type.ACTIVE, new Address("localhost", 5000), new Address("localhost", 6000), instant);
assertEquals(member.type(), Member.Type.ACTIVE);
assertEquals(member.status(), ServerMember.Status.AVAILABLE);
assertEquals(member.serverAddress(), new Address("localhost", 5000));
assertEquals(member.clientAddress(), new Address("localhost", 6000));
assertEquals(member.updated(), instant);
}
代码示例来源:origin: stackoverflow.com
Address addressData = new Address();
addressData.setContact_id(contact_id);
addressData.setCity(city);
addressData.setStreet(street);
addressData.setZipCode(zipCode);
HashMap<String,Address> map = new HashMap<String, Address>();
map.put("data", addressData);
long newId = datasource.createAddress(map);
代码示例来源:origin: atomix/copycat
/**
* Tests serializing and deserializing a member.
*/
public void testSerializeDeserialize() {
Instant instant = Instant.now();
ServerMember member = new ServerMember(Member.Type.ACTIVE, new Address("localhost", 5000), null, instant);
Serializer serializer = new Serializer().resolve(new ProtocolSerialization(), new ServerSerialization(), new StorageSerialization());
ServerMember result = serializer.readObject(serializer.writeObject(member).flip());
assertEquals(result.type(), member.type());
assertEquals(result.updated(), member.updated());
}
内容来源于网络,如有侵权,请联系作者删除!