Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
io.fabric8.openshift.api.model.template.Template Maven / Gradle / Ivy
package io.fabric8.openshift.api.model.template;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Generated;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonValue;
import io.fabric8.KubernetesJson;
import io.fabric8.kubernetes.api.model.KubernetesList;
import io.fabric8.kubernetes.api.model.Namespace;
import io.fabric8.kubernetes.api.model.ObjectMeta;
import io.fabric8.kubernetes.api.model.Pod;
import io.fabric8.kubernetes.api.model.ReplicationController;
import io.fabric8.kubernetes.api.model.Secret;
import io.fabric8.kubernetes.api.model.Service;
import io.fabric8.openshift.api.model.BuildConfig;
import io.fabric8.openshift.api.model.DeploymentConfig;
import io.fabric8.openshift.api.model.ImageStream;
import io.fabric8.openshift.api.model.OAuthAccessToken;
import io.fabric8.openshift.api.model.OAuthClient;
import io.fabric8.openshift.api.model.OAuthClientAuthorization;
import io.fabric8.openshift.api.model.Route;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
/**
*
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@Generated("org.jsonschema2pojo")
@JsonPropertyOrder({
"apiVersion",
"kind",
"labels",
"metadata",
"objects",
"parameters"
})
public class Template implements KubernetesJson {
/**
*
* (Required)
*
*/
@JsonProperty("apiVersion")
@NotNull
private Template.ApiVersion apiVersion = Template.ApiVersion.fromValue("v1beta3");
/**
*
* (Required)
*
*/
@JsonProperty("kind")
@NotNull
private java.lang.String kind = "Template";
/**
*
*
*/
@JsonProperty("labels")
@Valid
private Map labels;
/**
*
*
*/
@JsonProperty("metadata")
@Valid
private ObjectMeta metadata;
/**
*
*
*/
@JsonProperty("objects")
@Valid
private List objects = new ArrayList();
/**
*
*
*/
@JsonProperty("parameters")
@Valid
private List parameters = new ArrayList();
@JsonIgnore
private Map additionalProperties = new HashMap();
/**
* list of services
* Note: This is not to be used. Added for influencing the generation of fluent nested builders
*/
@JsonIgnore
private final List services = new ArrayList<>();
/**
* list of replication controllers
* Note: This is not to be used. Added for influencing the generation of fluent nested builders
*/
@JsonIgnore
private final List replicationControllers = new ArrayList<>();
/**
* list of pods.
* Note: This is not to be used. Added for influencing the generation of fluent nested builders
*
*/
@JsonIgnore
private final List pods = new ArrayList<>();
/**
* list of build configs
* Note: This is not to be used. Added for influencing the generation of fluent nested builders
*
*/
@JsonIgnore
private final List buildConfigs = new ArrayList<>();
/**
* list of deployment configs
* Note: This is not to be used. Added for influencing the generation of fluent nested builders
*/
@JsonIgnore
private final List deploymentConfigs = new ArrayList<>();
/**
* list of image repositories
* Note: This is not to be used. Added for influencing the generation of fluent nested builders
*/
@JsonIgnore
private final List imageStreams = new ArrayList<>();
/**
* list of routes
* Note: This is not to be used. Added for influencing the generation of fluent nested builders.
*/
@JsonIgnore
private final List routes = new ArrayList<>();
/**
* list of routes
* Note: This is not to be used. Added for influencing the generation of fluent nested builders.
*/
@JsonIgnore
private final List templates = new ArrayList<>();
/**
* list of oauth clients
* Note: This is not to be used. Added for influencing the generation of fluent nested builders.
*/
@JsonIgnore
private final List oAuthClients = new ArrayList<>();
/**
* list of oauth client authorizations
* Note: This is not to be used. Added for influencing the generation of fluent nested builders.
*/
@JsonIgnore
private final List oAuthClientAuthorizations = new ArrayList<>();
/**
* list of oauth access tokens
* Note: This is not to be used. Added for influencing the generation of fluent nested builders.
*/
@JsonIgnore
private final List oAuthAccessTokens = new ArrayList<>();
/**
* list of namespaces
* Note: This is not to be used. Added for influencing the generation of fluent nested builders.
*/
@JsonIgnore
private final List namespaces = new ArrayList<>();
/**
* list of secretes
* Note: This is not to be used. Added for influencing the generation of fluent nested builders.
*/
@JsonIgnore
private final List secrets = new ArrayList<>();
/**
* No args constructor for use in serialization
*
*/
public Template() {
}
/**
*
* @param apiVersion
* @param labels
* @param parameters
* @param objects
* @param kind
* @param metadata
*/
public Template(Template.ApiVersion apiVersion, java.lang.String kind, Map labels, ObjectMeta metadata, List objects, List parameters,List services,
List replicationControllers,
List pods,
List buildConfigs,
List deploymentConfigs,
List imageStreams,
List routes,
List templates,
List oAuthClients,
List oAuthClientAuthorizations,
List oAuthAccessTokens,
List namespaces,
List secrets) {
this.apiVersion = apiVersion;
this.kind = kind;
this.labels = labels;
this.metadata = metadata;
this.objects = objects;
this.parameters = parameters;
this.setObjects(objects);
this.services.addAll(services != null ? services : Collections.emptyList());
this.replicationControllers.addAll(replicationControllers != null ? replicationControllers : Collections.emptyList());
this.pods.addAll(pods != null ? pods : Collections.emptyList());
this.buildConfigs.addAll(buildConfigs != null ? buildConfigs : Collections.emptyList());
this.deploymentConfigs.addAll(deploymentConfigs != null ? deploymentConfigs : Collections.emptyList());
this.imageStreams.addAll(imageStreams != null ? imageStreams : Collections.emptyList());
this.routes.addAll(routes != null ? routes : Collections.emptyList());
this.templates.addAll(templates != null ? templates : Collections.emptyList());
this.oAuthClients.addAll(oAuthClients != null ? oAuthClients : Collections.emptyList());
this.oAuthClientAuthorizations.addAll(oAuthClientAuthorizations != null ? oAuthClientAuthorizations : Collections.emptyList());
this.oAuthAccessTokens.addAll(oAuthAccessTokens != null ? oAuthAccessTokens : Collections.emptyList());
this.namespaces.addAll(namespaces != null ? namespaces : Collections.emptyList());
this.secrets.addAll(secrets != null ? secrets : Collections.emptyList());
}
/**
*
* (Required)
*
* @return
* The apiVersion
*/
@JsonProperty("apiVersion")
public Template.ApiVersion getApiVersion() {
return apiVersion;
}
/**
*
* (Required)
*
* @param apiVersion
* The apiVersion
*/
@JsonProperty("apiVersion")
public void setApiVersion(Template.ApiVersion apiVersion) {
this.apiVersion = apiVersion;
}
/**
*
* (Required)
*
* @return
* The kind
*/
@JsonProperty("kind")
public java.lang.String getKind() {
return kind;
}
/**
*
* (Required)
*
* @param kind
* The kind
*/
@JsonProperty("kind")
public void setKind(java.lang.String kind) {
this.kind = kind;
}
/**
*
*
* @return
* The labels
*/
@JsonProperty("labels")
public Map getLabels() {
return labels;
}
/**
*
*
* @param labels
* The labels
*/
@JsonProperty("labels")
public void setLabels(Map labels) {
this.labels = labels;
}
/**
*
*
* @return
* The metadata
*/
@JsonProperty("metadata")
public ObjectMeta getMetadata() {
return metadata;
}
/**
*
*
* @param metadata
* The metadata
*/
@JsonProperty("metadata")
public void setMetadata(ObjectMeta metadata) {
this.metadata = metadata;
}
/**
*
*
* @return
* The objects
*/
@JsonProperty("objects")
public List getObjects() {
List allItems = new ArrayList<>(objects);
allItems.addAll(services);
allItems.addAll(replicationControllers);
allItems.addAll(pods);
allItems.addAll(buildConfigs);
allItems.addAll(deploymentConfigs);
allItems.addAll(imageStreams);
allItems.addAll(routes);
allItems.addAll(templates);
allItems.addAll(oAuthClients);
allItems.addAll(oAuthClientAuthorizations);
allItems.addAll(oAuthAccessTokens);
allItems.addAll(namespaces);
allItems.addAll(secrets);
return allItems;
}
/**
*
*
* @param objects
* The objects
*/
@JsonProperty("objects")
@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.PROPERTY,
property = "kind")
@JsonSubTypes({
@JsonSubTypes.Type(value = KubernetesList.class, name = "List"),
@JsonSubTypes.Type(value = Service.class, name = "Service"),
@JsonSubTypes.Type(value = Pod.class, name = "Pod"),
@JsonSubTypes.Type(value = ReplicationController.class, name = "ReplicationController"),
@JsonSubTypes.Type(value = BuildConfig.class, name = "BuildConfig"),
@JsonSubTypes.Type(value = DeploymentConfig.class, name = "DeploymentConfig"),
@JsonSubTypes.Type(value = ImageStream.class, name = "ImageStream"),
@JsonSubTypes.Type(value = Route.class, name = "Route"),
@JsonSubTypes.Type(value = Template.class, name = "Template"),
@JsonSubTypes.Type(value = OAuthClient.class, name = "OAuthClient"),
@JsonSubTypes.Type(value = OAuthClientAuthorization.class, name = "OAuthClientAuthorization"),
@JsonSubTypes.Type(value = OAuthAccessToken.class, name = "OAuthAccessToken"),
@JsonSubTypes.Type(value = Namespace.class, name = "Namespace"),
@JsonSubTypes.Type(value = Secret.class, name = "Secrets")
})
public void setObjects(List objects) {
for (Object item : objects) {
if (item instanceof Service) {
this.services.add((Service) item);
} else if (item instanceof ReplicationController) {
this.replicationControllers.add((ReplicationController) item);
} else if (item instanceof Pod) {
this.pods.add((Pod) item);
} else if (item instanceof BuildConfig) {
this.buildConfigs.add((BuildConfig) item);
} else if (item instanceof DeploymentConfig) {
this.deploymentConfigs.add((DeploymentConfig) item);
} else if (item instanceof ImageStream) {
this.imageStreams.add((ImageStream) item);
} else if (item instanceof Route) {
this.routes.add((Route) item);
} else if (item instanceof Template) {
this.templates.add((Template) item);
}
}
}
/**
*
*
* @return
* The parameters
*/
@JsonProperty("parameters")
public List getParameters() {
return parameters;
}
/**
*
*
* @param parameters
* The parameters
*/
@JsonProperty("parameters")
public void setParameters(List parameters) {
this.parameters = parameters;
}
@Override
public java.lang.String toString() {
return ToStringBuilder.reflectionToString(this);
}
@JsonAnyGetter
public Map getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(java.lang.String name, java.lang.Object value) {
this.additionalProperties.put(name, value);
}
@Override
public int hashCode() {
return new HashCodeBuilder().append(apiVersion).append(kind).append(labels).append(metadata).append(objects).append(parameters).append(additionalProperties).toHashCode();
}
@Override
public boolean equals(java.lang.Object other) {
if (other == this) {
return true;
}
if ((other instanceof Template) == false) {
return false;
}
Template rhs = ((Template) other);
return new EqualsBuilder().append(apiVersion, rhs.apiVersion).append(kind, rhs.kind).append(labels, rhs.labels).append(metadata, rhs.metadata).append(objects, rhs.objects).append(parameters, rhs.parameters).append(additionalProperties, rhs.additionalProperties).isEquals();
}
@Generated("org.jsonschema2pojo")
public static enum ApiVersion {
V_1_BETA_1("v1beta1"),
V_1_BETA_2("v1beta2"),
V_1_BETA_3("v1beta3");
private final java.lang.String value;
private static Map constants = new HashMap();
static {
for (Template.ApiVersion c: values()) {
constants.put(c.value, c);
}
}
private ApiVersion(java.lang.String value) {
this.value = value;
}
@JsonValue
@Override
public java.lang.String toString() {
return this.value;
}
@JsonCreator
public static Template.ApiVersion fromValue(java.lang.String value) {
Template.ApiVersion constant = constants.get(value);
if (constant == null) {
throw new IllegalArgumentException(value);
} else {
return constant;
}
}
}
@JsonIgnore
public List getServices() {
return services;
}
@JsonIgnore
public List getReplicationControllers() {
return replicationControllers;
}
@JsonIgnore
public List getPods() {
return pods;
}
@JsonIgnore
public List getBuildConfigs() {
return buildConfigs;
}
@JsonIgnore
public List getDeploymentConfigs() {
return deploymentConfigs;
}
@JsonIgnore
public List getImageStreams() {
return imageStreams;
}
@JsonIgnore
public List getRoutes() {
return routes;
}
@JsonIgnore
public List getTemplates() {
return templates;
}
@JsonIgnore
public List getOAuthClients() {
return oAuthClients;
}
@JsonIgnore
public List getOAuthClientAuthorizations() {
return oAuthClientAuthorizations;
}
@JsonIgnore
public List getOAuthAccessTokens() {
return oAuthAccessTokens;
}
@JsonIgnore
public List getNamespaces() {
return namespaces;
}
@JsonIgnore
public List getSecrets() {
return secrets;
}
}