Package org.eclipse.ecf.core.security
Class BooleanCallback
- java.lang.Object
-
- org.eclipse.ecf.core.security.BooleanCallback
-
- All Implemented Interfaces:
Serializable,Callback
public class BooleanCallback extends Object implements Callback, Serializable
Callback that handles Boolean types- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BooleanCallback(String prompt)Construct aBooleanCallbackwith a prompt.BooleanCallback(String prompt, boolean defaultValue)Construct aNameCallbackwith a prompt and default name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleangetDefaultValue()Get the default value.StringgetPrompt()Get the prompt.booleangetValue()Get the retrieved value.voidsetValue(boolean val)Set the retrieved name.
-
-
-
Constructor Detail
-
BooleanCallback
public BooleanCallback(String prompt)
Construct aBooleanCallbackwith a prompt.- Parameters:
prompt- the prompt used to request the boolean value.- Throws:
IllegalArgumentException- ifpromptis null or ifprompthas a length of 0.
-
BooleanCallback
public BooleanCallback(String prompt, boolean defaultValue)
Construct aNameCallbackwith a prompt and default name.- Parameters:
prompt- the prompt used to request the information.defaultValue- the value to be used as the default value displayed with the prompt.- Throws:
IllegalArgumentException- ifpromptis null.
-
-
Method Detail
-
getPrompt
public String getPrompt()
Get the prompt.- Returns:
- the prompt value.
-
getDefaultValue
public boolean getDefaultValue()
Get the default value.- Returns:
- the default value, or null if this
BooleanCallbackwas not instantiated with adefaultValue.
-
setValue
public void setValue(boolean val)
Set the retrieved name.- Parameters:
val- the retrieved valuetrueorfalse.- See Also:
getValue()
-
getValue
public boolean getValue()
Get the retrieved value.- Returns:
- the retrieved value
trueorfalse. - See Also:
setValue(boolean)
-
-