jezuch.utils.starmapper.encoders
Class ImageEncoder.Parameter

java.lang.Object
  |
  +--jezuch.utils.starmapper.encoders.ImageEncoder.Parameter
Enclosing class:
ImageEncoder

public static class ImageEncoder.Parameter
extends java.lang.Object

Class containing information for one encoder parameter. Properties of parameter are name, default value, boolean flag indicating if this parameter is required and optional list of possible values. The flag is not passed to constructor - parameter is considered required when default value is null or null string. This class does *not* hold values of parameters passed to encoder, it is only for information purposes.


Constructor Summary
ImageEncoder.Parameter(java.lang.String name, java.lang.String defValue, java.lang.String[] values)
          Constructs new encoder parameter from given name, default value and set of values.
 
Method Summary
 java.lang.String getDefaultValue()
          Returns default value of this parameter.
 java.lang.String getName()
           
 java.lang.String[] getPossibleValues()
          Return list of possible parameter's values as array of Strings.
 boolean isRequired()
          Returns true if this parameter is required, that is if it has no default value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageEncoder.Parameter

public ImageEncoder.Parameter(java.lang.String name,
                              java.lang.String defValue,
                              java.lang.String[] values)
Constructs new encoder parameter from given name, default value and set of values. If default value is null or null string, the parameter is considered required.

Parameters:
name - parameter's name
defValue - parameter's default value
values - list of possible values or null if any value (non-null) is legal.
Throws:
java.lang.IllegalArgumentException - thrown if passed name is null or contains only whitespaces or at least one of possible values is null.
Method Detail

getDefaultValue

public java.lang.String getDefaultValue()
Returns default value of this parameter. It is never null, even if parameter was initialised with null default value. In this case, null string is returned.

Returns:
default value of this parameter

getName

public java.lang.String getName()
Returns:
parameter's name

getPossibleValues

public java.lang.String[] getPossibleValues()
Return list of possible parameter's values as array of Strings. This method returns clone of original list of values or null if any non-null value is legal.

Returns:
list of possible values or null

isRequired

public boolean isRequired()
Returns true if this parameter is required, that is if it has no default value. Any other parameter is assigned default value if there's no value specified.

Returns:
bollean value indicating if this parameter is required