io.fabric8.kubernetes.api.model.KubernetesList Maven / Gradle / Ivy
package io.fabric8.kubernetes.api.model;
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 io.fabric8.KubernetesJson;
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 io.fabric8.openshift.api.model.template.Template;
import javax.annotation.Generated;
import java.util.*;
/**
*
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@Generated("org.jsonschema2pojo")
@JsonPropertyOrder({
"annotations",
"apiVersion",
"creationTimestamp",
"deletionTimestamp",
"generateName",
"id",
"items",
"kind",
"namespace",
"resourceVersion",
"selfLink",
"uid"
})
public class KubernetesList extends BaseKubernetesList implements KubernetesJson {
/**
* 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 KubernetesList() {
super();
}
public KubernetesList(KubernetesList.ApiVersion apiVersion,
List items,
String kind,
ListMeta metadata,
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) {
super(apiVersion, items, kind, metadata);
this.setItems(items);
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());
}
/**
* list of objects
*
* @return
* The items
*/
@JsonProperty("items")
@Override
public List getItems() {
HasMetadatSet allItems = new HasMetadatSet(super.getItems());
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 new ArrayList<>(allItems);
}
@JsonProperty("items")
@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")
})
@Override
public void setItems(List items) {
this.services.clear();
this.replicationControllers.clear();
this.pods.clear();
this.buildConfigs.clear();
this.deploymentConfigs.clear();
this.imageStreams.clear();
this.routes.clear();
this.templates.clear();
this.oAuthClients.clear();
this.oAuthClientAuthorizations.clear();
this.oAuthAccessTokens.clear();
this.namespaces.clear();
this.secrets.clear();
for (HasMetadata item : items) {
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);
} else if (item instanceof OAuthClient) {
this.oAuthClients.add((OAuthClient)item);
} else if (item instanceof OAuthClientAuthorization) {
this.oAuthClientAuthorizations.add((OAuthClientAuthorization) item);
}else if (item instanceof OAuthAccessToken) {
this.oAuthAccessTokens.add((OAuthAccessToken) item);
} else if (item instanceof Namespace) {
this.namespaces.add((Namespace) item);
} else if (item instanceof Secret) {
this.secrets.add((Secret) item);
}
}
}
@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;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy