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 aBooleanCallback
with a prompt.BooleanCallback(String prompt, boolean defaultValue)
Construct aNameCallback
with a prompt and default name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
getDefaultValue()
Get the default value.String
getPrompt()
Get the prompt.boolean
getValue()
Get the retrieved value.void
setValue(boolean val)
Set the retrieved name.
-
-
-
Constructor Detail
-
BooleanCallback
public BooleanCallback(String prompt)
Construct aBooleanCallback
with a prompt.- Parameters:
prompt
- the prompt used to request the boolean value.- Throws:
IllegalArgumentException
- ifprompt
is null or ifprompt
has a length of 0.
-
BooleanCallback
public BooleanCallback(String prompt, boolean defaultValue)
Construct aNameCallback
with 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
- ifprompt
is 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
BooleanCallback
was not instantiated with adefaultValue
.
-
setValue
public void setValue(boolean val)
Set the retrieved name.- Parameters:
val
- the retrieved valuetrue
orfalse
.- See Also:
getValue()
-
getValue
public boolean getValue()
Get the retrieved value.- Returns:
- the retrieved value
true
orfalse
. - See Also:
setValue(boolean)
-
-