All Downloads are FREE. Search and download functionalities are using the official Maven repository.

generator.server.javatool.protobuf.main.ProtobufDatesWriter.mustache Maven / Gradle / Ivy

There is a newer version: 1.22.0
Show newest version
package {{packageName}}.shared.protobuf.infrastructure.secondary;

import com.google.protobuf.Timestamp;
import java.time.Instant;

public final class ProtobufDatesWriter {

  private ProtobufDatesWriter() {}

  public static Timestamp buildTimestamp(Instant instant) {
    if (instant == null) {
      return null;
    }

    return Timestamp.newBuilder().setSeconds(instant.getEpochSecond()).setNanos(instant.getNano()).build();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy