public class Resource extends Object implements Serializable, Cloneable
Describes the resources available for a container instance.
Constructor and Description |
---|
Resource() |
Modifier and Type | Method and Description |
---|---|
Resource |
clone() |
boolean |
equals(Object obj) |
Double |
getDoubleValue()
When the
doubleValue type is set, the value of the
resource must be a double precision floating-point type. |
Integer |
getIntegerValue()
When the
integerValue type is set, the value of the
resource must be an integer. |
Long |
getLongValue()
When the
longValue type is set, the value of the resource
must be an extended precision floating-point type. |
String |
getName()
The name of the resource, such as
CPU ,
MEMORY , PORTS , or a user-defined resource. |
List<String> |
getStringSetValue()
When the
stringSetValue type is set, the value of the
resource must be a string type. |
String |
getType()
The type of the resource, such as
INTEGER ,
DOUBLE , LONG , or STRINGSET . |
int |
hashCode() |
void |
setDoubleValue(Double doubleValue)
When the
doubleValue type is set, the value of the
resource must be a double precision floating-point type. |
void |
setIntegerValue(Integer integerValue)
When the
integerValue type is set, the value of the
resource must be an integer. |
void |
setLongValue(Long longValue)
When the
longValue type is set, the value of the resource
must be an extended precision floating-point type. |
void |
setName(String name)
The name of the resource, such as
CPU ,
MEMORY , PORTS , or a user-defined resource. |
void |
setStringSetValue(Collection<String> stringSetValue)
When the
stringSetValue type is set, the value of the
resource must be a string type. |
void |
setType(String type)
The type of the resource, such as
INTEGER ,
DOUBLE , LONG , or STRINGSET . |
String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
Resource |
withDoubleValue(Double doubleValue)
When the
doubleValue type is set, the value of the
resource must be a double precision floating-point type. |
Resource |
withIntegerValue(Integer integerValue)
When the
integerValue type is set, the value of the
resource must be an integer. |
Resource |
withLongValue(Long longValue)
When the
longValue type is set, the value of the resource
must be an extended precision floating-point type. |
Resource |
withName(String name)
The name of the resource, such as
CPU ,
MEMORY , PORTS , or a user-defined resource. |
Resource |
withStringSetValue(Collection<String> stringSetValue)
When the
stringSetValue type is set, the value of the
resource must be a string type. |
Resource |
withStringSetValue(String... stringSetValue)
When the
stringSetValue type is set, the value of the
resource must be a string type. |
Resource |
withType(String type)
The type of the resource, such as
INTEGER ,
DOUBLE , LONG , or STRINGSET . |
public String getName()
CPU
,
MEMORY
, PORTS
, or a user-defined resource.CPU
,
MEMORY
, PORTS
, or a user-defined resource.public void setName(String name)
CPU
,
MEMORY
, PORTS
, or a user-defined resource.name
- The name of the resource, such as CPU
,
MEMORY
, PORTS
, or a user-defined resource.public Resource withName(String name)
CPU
,
MEMORY
, PORTS
, or a user-defined resource.
Returns a reference to this object so that method calls can be chained together.
name
- The name of the resource, such as CPU
,
MEMORY
, PORTS
, or a user-defined resource.public String getType()
INTEGER
,
DOUBLE
, LONG
, or STRINGSET
.INTEGER
,
DOUBLE
, LONG
, or STRINGSET
.public void setType(String type)
INTEGER
,
DOUBLE
, LONG
, or STRINGSET
.type
- The type of the resource, such as INTEGER
,
DOUBLE
, LONG
, or STRINGSET
.public Resource withType(String type)
INTEGER
,
DOUBLE
, LONG
, or STRINGSET
.
Returns a reference to this object so that method calls can be chained together.
type
- The type of the resource, such as INTEGER
,
DOUBLE
, LONG
, or STRINGSET
.public Double getDoubleValue()
doubleValue
type is set, the value of the
resource must be a double precision floating-point type.doubleValue
type is set, the value of the
resource must be a double precision floating-point type.public void setDoubleValue(Double doubleValue)
doubleValue
type is set, the value of the
resource must be a double precision floating-point type.doubleValue
- When the doubleValue
type is set, the value of the
resource must be a double precision floating-point type.public Resource withDoubleValue(Double doubleValue)
doubleValue
type is set, the value of the
resource must be a double precision floating-point type.
Returns a reference to this object so that method calls can be chained together.
doubleValue
- When the doubleValue
type is set, the value of the
resource must be a double precision floating-point type.public Long getLongValue()
longValue
type is set, the value of the resource
must be an extended precision floating-point type.longValue
type is set, the value of the resource
must be an extended precision floating-point type.public void setLongValue(Long longValue)
longValue
type is set, the value of the resource
must be an extended precision floating-point type.longValue
- When the longValue
type is set, the value of the resource
must be an extended precision floating-point type.public Resource withLongValue(Long longValue)
longValue
type is set, the value of the resource
must be an extended precision floating-point type.
Returns a reference to this object so that method calls can be chained together.
longValue
- When the longValue
type is set, the value of the resource
must be an extended precision floating-point type.public Integer getIntegerValue()
integerValue
type is set, the value of the
resource must be an integer.integerValue
type is set, the value of the
resource must be an integer.public void setIntegerValue(Integer integerValue)
integerValue
type is set, the value of the
resource must be an integer.integerValue
- When the integerValue
type is set, the value of the
resource must be an integer.public Resource withIntegerValue(Integer integerValue)
integerValue
type is set, the value of the
resource must be an integer.
Returns a reference to this object so that method calls can be chained together.
integerValue
- When the integerValue
type is set, the value of the
resource must be an integer.public List<String> getStringSetValue()
stringSetValue
type is set, the value of the
resource must be a string type.stringSetValue
type is set, the value of the
resource must be a string type.public void setStringSetValue(Collection<String> stringSetValue)
stringSetValue
type is set, the value of the
resource must be a string type.stringSetValue
- When the stringSetValue
type is set, the value of the
resource must be a string type.public Resource withStringSetValue(String... stringSetValue)
stringSetValue
type is set, the value of the
resource must be a string type.
NOTE: This method appends the values to the existing list (if
any). Use setStringSetValue(java.util.Collection)
or withStringSetValue(java.util.Collection)
if you want to override the
existing values.
Returns a reference to this object so that method calls can be chained together.
stringSetValue
- When the stringSetValue
type is set, the value of the
resource must be a string type.public Resource withStringSetValue(Collection<String> stringSetValue)
stringSetValue
type is set, the value of the
resource must be a string type.
Returns a reference to this object so that method calls can be chained together.
stringSetValue
- When the stringSetValue
type is set, the value of the
resource must be a string type.public String toString()
toString
in class Object
Object.toString()
Copyright © 2015. All rights reserved.