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

events.UUID Maven / Gradle / Ivy

Go to download

Java support for Cloud Foundry's Loggregator using the Dropsonde protocol.

There is a newer version: 0.5
Show newest version
// Code generated by Wire protocol buffer compiler, do not edit.
// Source file: /Users/mheath/projects/snotel/target/checkout/client/src/main/proto/events/uuid.proto
package events;

import com.squareup.wire.Message;
import com.squareup.wire.ProtoField;

import static com.squareup.wire.Message.Datatype.UINT64;
import static com.squareup.wire.Message.Label.REQUIRED;

/**
 * / Type representing a 128-bit UUID.
 */
public final class UUID extends Message {

  public static final Long DEFAULT_LOW = 0L;
  public static final Long DEFAULT_HIGH = 0L;

  @ProtoField(tag = 1, type = UINT64, label = REQUIRED)
  public final Long low;

  @ProtoField(tag = 2, type = UINT64, label = REQUIRED)
  public final Long high;

  public UUID(Long low, Long high) {
    this.low = low;
    this.high = high;
  }

  private UUID(Builder builder) {
    this(builder.low, builder.high);
    setBuilder(builder);
  }

  @Override
  public boolean equals(Object other) {
    if (other == this) return true;
    if (!(other instanceof UUID)) return false;
    UUID o = (UUID) other;
    return equals(low, o.low)
        && equals(high, o.high);
  }

  @Override
  public int hashCode() {
    int result = hashCode;
    if (result == 0) {
      result = low != null ? low.hashCode() : 0;
      result = result * 37 + (high != null ? high.hashCode() : 0);
      hashCode = result;
    }
    return result;
  }

  public static final class Builder extends Message.Builder {

    public Long low;
    public Long high;

    public Builder() {
    }

    public Builder(UUID message) {
      super(message);
      if (message == null) return;
      this.low = message.low;
      this.high = message.high;
    }

    public Builder low(Long low) {
      this.low = low;
      return this;
    }

    public Builder high(Long high) {
      this.high = high;
      return this;
    }

    @Override
    public UUID build() {
      checkRequiredFields();
      return new UUID(this);
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy