/** * <code>.google.protobuf.Timestamp time = 1;</code> */ public com.google.protobuf.TimestampOrBuilder getTimeOrBuilder() { return getTime(); }
/** * <code>.google.protobuf.Timestamp time = 1;</code> */ public com.google.protobuf.TimestampOrBuilder getTimeOrBuilder() { return getTime(); }
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (time_ != null) { output.writeMessage(1, getTime()); } unknownFields.writeTo(output); }
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (time_ != null) { output.writeMessage(1, getTime()); } unknownFields.writeTo(output); }
public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (time_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, getTime()); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (time_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, getTime()); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.salesforce.servicelibs.TimeReply)) { return super.equals(obj); } com.salesforce.servicelibs.TimeReply other = (com.salesforce.servicelibs.TimeReply) obj; boolean result = true; result = result && (hasTime() == other.hasTime()); if (hasTime()) { result = result && getTime() .equals(other.getTime()); } result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.salesforce.servicelibs.TimeReply)) { return super.equals(obj); } com.salesforce.servicelibs.TimeReply other = (com.salesforce.servicelibs.TimeReply) obj; boolean result = true; result = result && (hasTime() == other.hasTime()); if (hasTime()) { result = result && getTime() .equals(other.getTime()); } result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasTime()) { hash = (37 * hash) + TIME_FIELD_NUMBER; hash = (53 * hash) + getTime().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasTime()) { hash = (37 * hash) + TIME_FIELD_NUMBER; hash = (53 * hash) + getTime().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
public Builder mergeFrom(com.salesforce.servicelibs.TimeReply other) { if (other == com.salesforce.servicelibs.TimeReply.getDefaultInstance()) return this; if (other.hasTime()) { mergeTime(other.getTime()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
public Builder mergeFrom(com.salesforce.servicelibs.TimeReply other) { if (other == com.salesforce.servicelibs.TimeReply.getDefaultInstance()) return this; if (other.hasTime()) { mergeTime(other.getTime()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
public static void main(String[] args) throws Exception { String host = args[0]; int port = Integer.parseInt(args[1]); String abstractName = "mesh://timeService"; // Open a channel to the server Channel channel = ManagedChannelBuilder .forTarget(abstractName) .nameResolverFactory(StaticResolver.factory(new InetSocketAddress(host, port))) .usePlaintext(true) .build(); // Create a CompletableFuture-based stub TimeServiceGrpc8.TimeServiceCompletableFutureStub stub = TimeServiceGrpc8.newCompletableFutureStub(channel); // Call the service CompletableFuture<TimeReply> completableFuture = stub.getTime(Empty.getDefaultInstance()); TimeReply timeReply = completableFuture.get(); // Convert to JDK8 types Instant now = MoreTimestamps.toInstantUtc(timeReply.getTime()); System.out.println("The time is " + now); } }