org.crsh.cli.type
Class ValueType<V>

java.lang.Object
  extended by org.crsh.cli.type.ValueType<V>
Type Parameters:
V - the generic value type
Direct Known Subclasses:
PathValueType

public abstract class ValueType<V>
extends Object

A type for values.


Field Summary
static ValueType<Boolean> BOOLEAN
          .
protected  Class<? extends Completer> completer
          .
static ValueType<Enum> ENUM
          .
static ValueType<Integer> INTEGER
          .
static ValueType<ObjectName> OBJECT_NAME
          .
static ValueType<Properties> PROPERTIES
          .
static ValueType<String> STRING
          .
static ValueType<Thread> THREAD
          .
protected  Class<V> type
          .
 
Constructor Summary
protected ValueType(Class<V> type)
           
protected ValueType(Class<V> type, Class<? extends Completer> completer)
           
 
Method Summary
 boolean equals(Object obj)
           
 Class<? extends Completer> getCompleter()
           
(package private)  int getDistance(Class<?> clazz)
           
 Class<V> getType()
           
 int hashCode()
           
abstract
<S extends V>
S
parse(Class<S> type, String s)
           
 V parse(String s)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STRING

public static final ValueType<String> STRING
.


INTEGER

public static final ValueType<Integer> INTEGER
.


BOOLEAN

public static final ValueType<Boolean> BOOLEAN
.


ENUM

public static final ValueType<Enum> ENUM
.


PROPERTIES

public static final ValueType<Properties> PROPERTIES
.


OBJECT_NAME

public static final ValueType<ObjectName> OBJECT_NAME
.


THREAD

public static final ValueType<Thread> THREAD
.


type

protected final Class<V> type
.


completer

protected final Class<? extends Completer> completer
.

Constructor Detail

ValueType

protected ValueType(Class<V> type,
                    Class<? extends Completer> completer)
             throws NullPointerException
Throws:
NullPointerException

ValueType

protected ValueType(Class<V> type)
             throws NullPointerException
Throws:
NullPointerException
Method Detail

getDistance

final int getDistance(Class<?> clazz)

hashCode

public final int hashCode()
Overrides:
hashCode in class Object

equals

public final boolean equals(Object obj)
Overrides:
equals in class Object

getCompleter

public Class<? extends Completer> getCompleter()

getType

public final Class<V> getType()

parse

public final V parse(String s)
              throws Exception
Throws:
Exception

parse

public abstract <S extends V> S parse(Class<S> type,
                                      String s)
                           throws Exception
Throws:
Exception


Copyright © 2014 eXo Platform SAS. All Rights Reserved.