io.kubernetes.client.openapi.models.V1alpha1Scheduling Maven / Gradle / Ivy
/*
Copyright 2021 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package io.kubernetes.client.openapi.models;
import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/** Scheduling specifies the scheduling constraints for nodes supporting a RuntimeClass. */
@ApiModel(
description =
"Scheduling specifies the scheduling constraints for nodes supporting a RuntimeClass.")
@javax.annotation.Generated(
value = "org.openapitools.codegen.languages.JavaClientCodegen",
date = "2021-01-04T09:55:14.976Z[Etc/UTC]")
public class V1alpha1Scheduling {
public static final String SERIALIZED_NAME_NODE_SELECTOR = "nodeSelector";
@SerializedName(SERIALIZED_NAME_NODE_SELECTOR)
private Map nodeSelector = null;
public static final String SERIALIZED_NAME_TOLERATIONS = "tolerations";
@SerializedName(SERIALIZED_NAME_TOLERATIONS)
private List tolerations = null;
public V1alpha1Scheduling nodeSelector(Map nodeSelector) {
this.nodeSelector = nodeSelector;
return this;
}
public V1alpha1Scheduling putNodeSelectorItem(String key, String nodeSelectorItem) {
if (this.nodeSelector == null) {
this.nodeSelector = new HashMap<>();
}
this.nodeSelector.put(key, nodeSelectorItem);
return this;
}
/**
* nodeSelector lists labels that must be present on nodes that support this RuntimeClass. Pods
* using this RuntimeClass can only be scheduled to a node matched by this selector. The
* RuntimeClass nodeSelector is merged with a pod's existing nodeSelector. Any conflicts will
* cause the pod to be rejected in admission.
*
* @return nodeSelector
*/
@javax.annotation.Nullable
@ApiModelProperty(
value =
"nodeSelector lists labels that must be present on nodes that support this RuntimeClass. Pods using this RuntimeClass can only be scheduled to a node matched by this selector. The RuntimeClass nodeSelector is merged with a pod's existing nodeSelector. Any conflicts will cause the pod to be rejected in admission.")
public Map getNodeSelector() {
return nodeSelector;
}
public void setNodeSelector(Map nodeSelector) {
this.nodeSelector = nodeSelector;
}
public V1alpha1Scheduling tolerations(List tolerations) {
this.tolerations = tolerations;
return this;
}
public V1alpha1Scheduling addTolerationsItem(V1Toleration tolerationsItem) {
if (this.tolerations == null) {
this.tolerations = new ArrayList<>();
}
this.tolerations.add(tolerationsItem);
return this;
}
/**
* tolerations are appended (excluding duplicates) to pods running with this RuntimeClass during
* admission, effectively unioning the set of nodes tolerated by the pod and the RuntimeClass.
*
* @return tolerations
*/
@javax.annotation.Nullable
@ApiModelProperty(
value =
"tolerations are appended (excluding duplicates) to pods running with this RuntimeClass during admission, effectively unioning the set of nodes tolerated by the pod and the RuntimeClass.")
public List getTolerations() {
return tolerations;
}
public void setTolerations(List tolerations) {
this.tolerations = tolerations;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
V1alpha1Scheduling v1alpha1Scheduling = (V1alpha1Scheduling) o;
return Objects.equals(this.nodeSelector, v1alpha1Scheduling.nodeSelector)
&& Objects.equals(this.tolerations, v1alpha1Scheduling.tolerations);
}
@Override
public int hashCode() {
return Objects.hash(nodeSelector, tolerations);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class V1alpha1Scheduling {\n");
sb.append(" nodeSelector: ").append(toIndentedString(nodeSelector)).append("\n");
sb.append(" tolerations: ").append(toIndentedString(tolerations)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}