String idAsString() { return originId.toString(); }
/** * Sets origin ID from a string. * * @param id id * @return this builder */ public Builder id(String id) { this.originId = Id.id(id); return this; }
/** * Create a new Id. * * @param value string value of Id * @return a new Id */ public static Id id(String value) { return new Id(value); }
public boolean forApp(Id appId) { return this.appId.equals(appId); }
public boolean forApp(Id appId) { return this.appId.equals(appId); }
String idAsString() { return this.id.toString(); }
/** * Sets the ID of the application the origin belongs to from a string. * * @param applicationId application ID * @return this builder */ public Builder applicationId(String applicationId) { this.applicationId = Id.id(applicationId); return this; }
/** * Create a new Id. * * @param value string value of Id * @return a new Id */ public static Id id(String value) { return new Id(value); }
String appIdAsString() { return appId.toString(); }
/** * Sets the ID of the application the origin belongs to from a string. * * @param applicationId application ID * @return this builder */ public Builder applicationId(String applicationId) { this.applicationId = Id.id(applicationId); return this; }
String appIdAsString() { return appId.toString(); }
/** * Sets origin ID from a string. * * @param id id * @return this builder */ public Builder id(String id) { this.originId = Id.id(id); return this; }
String idAsString() { return this.id.toString(); }
/** * Sets an ID. * * @param id an ID * @return this builder */ public Builder id(String id) { return id(Id.id(id)); }
String idAsString() { return originId.toString(); }
/** * Sets an ID. * * @param id an ID * @return this builder */ public Builder id(String id) { return id(Id.id(id)); }
/** * Returns a string containing application ID and host/port in the format: ID-HOSTANDPORT. * * @return <ID-HOSTANDPORT> */ public String applicationInfo() { return applicationId.toString().toUpperCase() + "-" + host; }
@Override public Id id() { return Id.id(key); }
/** * Returns a string containing application ID and host/port in the format: ID-HOSTANDPORT. * * @return <ID-HOSTANDPORT> */ public String applicationInfo() { return applicationId.toString().toUpperCase() + "-" + hostAsString; }
Origin(String originId, String host) { this.originId = Id.id(originId); this.host = HostAndPort.fromString(host); this.hostAsString = this.host.toString(); this.applicationId = GENERIC_APP; this.hashCode = Objects.hash(this.host, this.originId); }