com.bekioui.maven.plugin.client.model.AutoValue_Resource Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of client-maven-plugin Show documentation
Show all versions of client-maven-plugin Show documentation
Generate java client of RESTful API.
package com.bekioui.maven.plugin.client.model;
import com.squareup.javapoet.MethodSpec;
import com.squareup.javapoet.TypeName;
import java.util.List;
import javax.annotation.Generated;
@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_Resource extends Resource {
private final TypeName typeName;
private final String className;
private final String fieldName;
private final List methods;
private AutoValue_Resource(
TypeName typeName,
String className,
String fieldName,
List methods) {
if (typeName == null) {
throw new NullPointerException("Null typeName");
}
this.typeName = typeName;
if (className == null) {
throw new NullPointerException("Null className");
}
this.className = className;
if (fieldName == null) {
throw new NullPointerException("Null fieldName");
}
this.fieldName = fieldName;
if (methods == null) {
throw new NullPointerException("Null methods");
}
this.methods = methods;
}
@Override
public TypeName typeName() {
return typeName;
}
@Override
public String className() {
return className;
}
@Override
public String fieldName() {
return fieldName;
}
@Override
public List methods() {
return methods;
}
@Override
public String toString() {
return "Resource{"
+ "typeName=" + typeName + ", "
+ "className=" + className + ", "
+ "fieldName=" + fieldName + ", "
+ "methods=" + methods
+ "}";
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof Resource) {
Resource that = (Resource) o;
return (this.typeName.equals(that.typeName()))
&& (this.className.equals(that.className()))
&& (this.fieldName.equals(that.fieldName()))
&& (this.methods.equals(that.methods()));
}
return false;
}
@Override
public int hashCode() {
int h = 1;
h *= 1000003;
h ^= typeName.hashCode();
h *= 1000003;
h ^= className.hashCode();
h *= 1000003;
h ^= fieldName.hashCode();
h *= 1000003;
h ^= methods.hashCode();
return h;
}
static final class Builder extends Resource.Builder {
private TypeName typeName;
private String className;
private String fieldName;
private List methods;
Builder() {
}
Builder(Resource source) {
this.typeName = source.typeName();
this.className = source.className();
this.fieldName = source.fieldName();
this.methods = source.methods();
}
@Override
public Resource.Builder typeName(TypeName typeName) {
this.typeName = typeName;
return this;
}
@Override
public Resource.Builder className(String className) {
this.className = className;
return this;
}
@Override
public Resource.Builder fieldName(String fieldName) {
this.fieldName = fieldName;
return this;
}
@Override
public Resource.Builder methods(List methods) {
this.methods = methods;
return this;
}
@Override
public Resource build() {
String missing = "";
if (typeName == null) {
missing += " typeName";
}
if (className == null) {
missing += " className";
}
if (fieldName == null) {
missing += " fieldName";
}
if (methods == null) {
missing += " methods";
}
if (!missing.isEmpty()) {
throw new IllegalStateException("Missing required properties:" + missing);
}
return new AutoValue_Resource(
this.typeName,
this.className,
this.fieldName,
this.methods);
}
}
}