@data public class RelationalConstraint extends Constraint
Eg. VirtualMachines whose host is esx1.vmware.com
| Modifier and Type | Field and Description |
|---|---|
Constraint |
constraintOnRelatedObject
A constraint on the related objects by the given relationship.
|
boolean |
hasInverseRelation
Indicates whether the constraint given by constraintOnRelatedObject
applies to the source, as opposed to the target of the relationship given in
this instance.
|
java.lang.String |
relation
The relation to match (the source type of the relation is defined by the
isSourceConstrainted property).
|
targetType| Constructor and Description |
|---|
RelationalConstraint() |
| Modifier and Type | Method and Description |
|---|---|
RelationalConstraint |
clone()
Creates and returns a copy of this object.
|
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
public java.lang.String relation
VMODL1 property names must never be qualified with resource model name (i.e. for resource type "VirtualMachine", property "name" is valid while "VirtualMachine/name" is not). VMODL2 property names must always be qualified with resource model name.
public boolean hasInverseRelation
If true, the relation defined by
constraintOnRelatedObject.targetType.relationship is used.
Thus the constraint can be referred to as an inverse-RelationalConstraint
(as the inverse relationship is used compared to the normal direction). Make
sure to explicitly set the constraintOnRelatedObject.targetType
value.
Example:
RelationalConstraint {
targetType = "VirtualMachine",
relationship = "vm", // HostSystem.vm relationship is used
hasInverseRelation = true,
constraintOnRelatedObject =
ObjectIdentityConstraint {
targetType = "HostSystem"
target = "host-1"
}
}
If false (i.e. the target is constrained), the relation defined by
this.targetType.relationship is used.
Example:
RelationalConstraint {
targetType = "VirtualMachine",
relationship = "host", // VirtualMachine.Host relationship is used
hasInverseRelation = false,
constraintOnRelatedObject =
ObjectIdentityConstraint {
targetType = null, // implicitly "HostSystem"
target = "host-1"
}
}
Default value is false.public Constraint constraintOnRelatedObject
public RelationalConstraint clone() throws java.lang.CloneNotSupportedException
clone in class Constraintjava.lang.CloneNotSupportedExceptionpublic boolean equals(java.lang.Object obj)
equals in class Constraintpublic int hashCode()
hashCode in class ConstraintCopyright @ 2013-2018 VMware, Inc. All rights reserved.