Skip to content

Instantly share code, notes, and snippets.

@joshdifabio
Created May 8, 2017 09:22
Show Gist options
  • Save joshdifabio/fe543b97e02e7ddac8edb73be38deb06 to your computer and use it in GitHub Desktop.
Save joshdifabio/fe543b97e02e7ddac8edb73be38deb06 to your computer and use it in GitHub Desktop.
AutoValue_MatchResult_Metadata.java
package org.apache.beam.sdk.io.fs;
import javax.annotation.Generated;
@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_MatchResult_Metadata extends MatchResult.Metadata {
private final ResourceId resourceId;
private final long sizeBytes;
private final boolean isReadSeekEfficient;
private AutoValue_MatchResult_Metadata(
ResourceId resourceId,
long sizeBytes,
boolean isReadSeekEfficient) {
this.resourceId = resourceId;
this.sizeBytes = sizeBytes;
this.isReadSeekEfficient = isReadSeekEfficient;
}
@Override
public ResourceId resourceId() {
return resourceId;
}
@Override
public long sizeBytes() {
return sizeBytes;
}
@Override
public boolean isReadSeekEfficient() {
return isReadSeekEfficient;
}
@Override
public String toString() {
return "Metadata{"
+ "resourceId=" + resourceId + ", "
+ "sizeBytes=" + sizeBytes + ", "
+ "isReadSeekEfficient=" + isReadSeekEfficient
+ "}";
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof MatchResult.Metadata) {
MatchResult.Metadata that = (MatchResult.Metadata) o;
return (this.resourceId.equals(that.resourceId()))
&& (this.sizeBytes == that.sizeBytes())
&& (this.isReadSeekEfficient == that.isReadSeekEfficient());
}
return false;
}
@Override
public int hashCode() {
int h = 1;
h *= 1000003;
h ^= this.resourceId.hashCode();
h *= 1000003;
h ^= (this.sizeBytes >>> 32) ^ this.sizeBytes;
h *= 1000003;
h ^= this.isReadSeekEfficient ? 1231 : 1237;
return h;
}
static final class Builder extends MatchResult.Metadata.Builder {
private ResourceId resourceId;
private Long sizeBytes;
private Boolean isReadSeekEfficient;
Builder() {
}
@Override
public MatchResult.Metadata.Builder setResourceId(ResourceId resourceId) {
if (resourceId == null) {
throw new NullPointerException("Null resourceId");
}
this.resourceId = resourceId;
return this;
}
@Override
public MatchResult.Metadata.Builder setSizeBytes(long sizeBytes) {
this.sizeBytes = sizeBytes;
return this;
}
@Override
public MatchResult.Metadata.Builder setIsReadSeekEfficient(boolean isReadSeekEfficient) {
this.isReadSeekEfficient = isReadSeekEfficient;
return this;
}
@Override
public MatchResult.Metadata build() {
String missing = "";
if (this.resourceId == null) {
missing += " resourceId";
}
if (this.sizeBytes == null) {
missing += " sizeBytes";
}
if (this.isReadSeekEfficient == null) {
missing += " isReadSeekEfficient";
}
if (!missing.isEmpty()) {
throw new IllegalStateException("Missing required properties:" + missing);
}
return new AutoValue_MatchResult_Metadata(
this.resourceId,
this.sizeBytes,
this.isReadSeekEfficient);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment