Package cdc.args
Class Arg
java.lang.Object
cdc.args.Arg
Effective argument.
It is a (name, value) pair.
- Author:
- Damien Carbonne
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangetName()getValue()<T> TReturns the value cast to a target class.<T> TReturns the value cast to a target class or a default value.Returns the value or a default value.inthashCode()booleanisCompliantWith(FormalArg<?> farg) booleanisCompliantWith(FormalArgs fargs) booleanisCompliantWith(Class<?> cls) toString()
-
Constructor Details
-
Arg
Creates an effective argument.No check is done on argument value.
- Parameters:
name- The name. It must be valid.value- the value.- Throws:
IllegalArgumentException- Whennameis invalid.
-
Arg
Creates an effective argument that is compliant with a formal argument.- Type Parameters:
T- The formal argument type.- Parameters:
farg- The formal argument.value- The value.- Throws:
IllegalArgumentException- Whenfargis null orvalueis not compliant withfarg.
-
-
Method Details
-
getName
- Returns:
- The name.
-
getValue
- Returns:
- The value.
-
getValue
Returns the value or a default value.- Parameters:
def- The default value.- Returns:
- The value or
defif value isnull.
-
getValue
Returns the value cast to a target class.- Type Parameters:
T- The target type.- Parameters:
cls- The target class.- Returns:
- The cast of value to
cls.
-
getValue
Returns the value cast to a target class or a default value.- Type Parameters:
T- The target type.- Parameters:
cls- The target class.def- The default value.- Returns:
- The value cats to
clsordefif value isnull.
-
isCompliantWith
-
isCompliantWith
-
isCompliantWith
-
hashCode
public int hashCode() -
equals
-
toString
-