Skip to content
This repository was archived by the owner on Sep 26, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
package com.google.api.gax.httpjson;

import java.util.List;
import java.util.Objects;
import javax.annotation.Nullable;

/**
Expand Down Expand Up @@ -58,4 +59,58 @@ public List<String> getFieldMask() {
public ApiMessage getApiMessageRequestBody() {
return null;
}

@Override
public boolean equals(Object other) {
return other instanceof EmptyMessage;
}

// This is a singleton class.
private static final EmptyMessage DEFAULT_INSTANCE = new EmptyMessage();

public static EmptyMessage getDefaultInstance() {
return DEFAULT_INSTANCE;
}

private EmptyMessage() {}

public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}

public static Builder newBuilder(EmptyMessage prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}

public Builder toBuilder() {
return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
}

public static class Builder {
Builder() {}

public Builder mergeFrom(EmptyMessage other) {
return this;
}

public Builder(EmptyMessage other) {}

public EmptyMessage build() {
return DEFAULT_INSTANCE;
}

public Builder clone() {
return new Builder();
}
}

@Override
public String toString() {
return "EmptyMessage{}";
}

@Override
public int hashCode() {
return Objects.hash(DEFAULT_INSTANCE);
}
}