public abstract class IntAttribute extends Attribute<Integer>
Constructor and Description |
---|
IntAttribute() |
Modifier and Type | Method and Description |
---|---|
abstract String |
getDoc()
The docstring to use for this attribute
|
abstract boolean |
getMandatory()
Whether this attribute is mandatory or not
|
abstract Integer |
getPreCoercionDefaultValue()
The default value to use if no value is provided.
|
TypeCoercer<?,Integer> |
getTypeCoercer()
The type coercer to use to convert raw values from the parser into something usable internally.
|
static IntAttribute |
of(Integer preCoercionDefaultValue,
String doc,
boolean mandatory,
List<Integer> values) |
void |
repr(com.google.devtools.build.lib.skylarkinterface.SkylarkPrinter printer) |
protected void |
validateCoercedValue(Integer value)
Validates values post-coercion to ensure other properties besides 'type' are valid
|
getAttribute, getGenericType, getPostCoercionTransform, getValue, validateProvidersPresent, validateValueInList
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public abstract Integer getPreCoercionDefaultValue()
Attribute
This will be validated against Attribute.getTypeCoercer()
, so may return a value whose type
does not match CoercedType
(e.g. a list of strings, rather than a list of SourcePath
)
getPreCoercionDefaultValue
in class Attribute<Integer>
public abstract String getDoc()
Attribute
public abstract boolean getMandatory()
Attribute
getMandatory
in class Attribute<Integer>
public void repr(com.google.devtools.build.lib.skylarkinterface.SkylarkPrinter printer)
public TypeCoercer<?,Integer> getTypeCoercer()
Attribute
getTypeCoercer
in class Attribute<Integer>
protected void validateCoercedValue(Integer value) throws CoerceFailedException
Attribute
validateCoercedValue
in class Attribute<Integer>
value
- The value to checkCoerceFailedException
- if the value is invalid (e.g. not in a list of pre-approved
values)public static IntAttribute of(Integer preCoercionDefaultValue, String doc, boolean mandatory, List<Integer> values)