Class MetadataTime
- java.lang.Object
-
- org.apache.accumulo.core.metadata.schema.MetadataTime
-
- All Implemented Interfaces:
Comparable<MetadataTime>
public final class MetadataTime extends Object implements Comparable<MetadataTime>
Immutable metadata time object
-
-
Constructor Summary
Constructors Constructor Description MetadataTime(long time, TimeType type)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(MetadataTime mtime)Stringencode()booleanequals(Object o)chargetCode()static chargetCode(TimeType type)longgetTime()TimeTypegetType()static TimeTypegetType(char code)Converts timetypes to data codes used in the table data implementationinthashCode()static MetadataTimeparse(String timestr)Creates a MetadataTime object from a string
-
-
-
Constructor Detail
-
MetadataTime
public MetadataTime(long time, TimeType type)
-
-
Method Detail
-
parse
public static MetadataTime parse(String timestr) throws IllegalArgumentException
Creates a MetadataTime object from a string- Parameters:
timestr- string representation of a metatdata time, ex. "M12345678"- Returns:
- a MetadataTime object represented by string
- Throws:
IllegalArgumentException
-
getType
public static TimeType getType(char code)
Converts timetypes to data codes used in the table data implementation- Parameters:
code- character M or L otherwise exception thrown- Returns:
- a TimeType
TimeTyperepresented by code.
-
getCode
public static char getCode(TimeType type)
- Returns:
- the single char code of this objects timeType
-
getCode
public char getCode()
-
encode
public String encode()
-
getType
public TimeType getType()
-
getTime
public long getTime()
-
compareTo
public int compareTo(MetadataTime mtime)
- Specified by:
compareToin interfaceComparable<MetadataTime>
-
-