public class FlagConvertor extends Object
| Modifier and Type | Field and Description |
|---|---|
static byte[] |
FLAGS_ANSWERED |
static byte[] |
FLAGS_DELETED |
static byte[] |
FLAGS_DRAFT |
static byte[] |
FLAGS_FLAGGED |
static byte[] |
FLAGS_RECENT |
static byte[] |
FLAGS_SEEN |
static byte[] |
FLAGS_USER |
static String |
PREFIX_SFLAGS |
static byte[] |
PREFIX_SFLAGS_B |
static String |
PREFIX_UFLAGS |
static byte[] |
PREFIX_UFLAGS_B |
| Constructor and Description |
|---|
FlagConvertor() |
| Modifier and Type | Method and Description |
|---|---|
static javax.mail.Flags.Flag |
systemFlagFromBytes(byte[] bytes)
Returns a
Flags.Flag coresponding to the supplyed
byte array. |
static byte[] |
systemFlagToBytes(javax.mail.Flags.Flag flag)
Converts a
Flags.Flag to a byte array representation
used for storing in HBase (as a column qualifier). |
static String |
userFlagFromBytes(byte[] bytes)
Converts a byte array to a user flag.
|
static byte[] |
userFlagToBytes(String flag)
Converts a user flag to a byte array for use as a HBase column qualifier.
|
public static final String PREFIX_SFLAGS
public static final byte[] PREFIX_SFLAGS_B
public static final String PREFIX_UFLAGS
public static final byte[] PREFIX_UFLAGS_B
public static final byte[] FLAGS_ANSWERED
public static final byte[] FLAGS_DELETED
public static final byte[] FLAGS_DRAFT
public static final byte[] FLAGS_FLAGGED
public static final byte[] FLAGS_RECENT
public static final byte[] FLAGS_SEEN
public static final byte[] FLAGS_USER
public static byte[] systemFlagToBytes(javax.mail.Flags.Flag flag)
Flags.Flag to a byte array representation
used for storing in HBase (as a column qualifier).flag - public static javax.mail.Flags.Flag systemFlagFromBytes(byte[] bytes)
Flags.Flag coresponding to the supplyed
byte array.bytes - byte array representationFlags.FlagRuntimeException - if the byte array does not match a
suitable represetnation.public static byte[] userFlagToBytes(String flag)
flag - user flag to convertpublic static String userFlagFromBytes(byte[] bytes)
bytes - the user flag byte representationString representaion of the user flagRuntimeException - if the user flag prefix is not found.Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.