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 int
compareTo(MetadataTime mtime)
String
encode()
boolean
equals(Object o)
char
getCode()
static char
getCode(TimeType type)
long
getTime()
TimeType
getType()
static TimeType
getType(char code)
Converts timetypes to data codes used in the table data implementationint
hashCode()
static MetadataTime
parse(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
- iftimesstr == null
ortimestr.length() <= 1)
-
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
TimeType
represented 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:
compareTo
in interfaceComparable<MetadataTime>
-
-