com.netflix.astyanax.thrift
Class ThriftUtils
java.lang.Object
com.netflix.astyanax.thrift.ThriftUtils
public class ThriftUtils
- extends java.lang.Object
|
Method Summary |
static org.apache.cassandra.thrift.SliceRange |
createAllInclusiveSliceRange()
|
static
<C> org.apache.cassandra.thrift.SliceRange |
|
createSliceRange(com.netflix.astyanax.Serializer<C> serializer,
C startColumn,
C endColumn,
boolean reversed,
int limit)
|
static
<T extends org.apache.thrift.TBase>
java.util.Properties |
|
getPropertiesFromThrift(T entity)
|
static
|
getThriftObjectFromProperties(java.lang.Class<T> clazz,
java.util.Properties props)
|
static java.lang.Object |
populateObjectFromProperties(java.lang.Object entity,
java.util.Properties props)
|
static java.util.Map<java.lang.String,java.lang.Object> |
propertiesToMap(java.util.Properties props)
Convert a Properties object into a tree |
static void |
setPropertiesFromThrift(java.lang.String prefix,
java.util.Properties properties,
org.apache.thrift.TBase entity)
Quick and dirty implementation that converts thrift DDL to a Properties object by flattening
the parameters |
static java.lang.Object |
valueForBasicType(java.lang.Object value,
byte type)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EMPTY_BYTE_BUFFER
public static final java.nio.ByteBuffer EMPTY_BYTE_BUFFER
MUTATION_OVERHEAD
public static final int MUTATION_OVERHEAD
- See Also:
- Constant Field Values
ThriftUtils
public ThriftUtils()
createAllInclusiveSliceRange
public static org.apache.cassandra.thrift.SliceRange createAllInclusiveSliceRange()
createSliceRange
public static <C> org.apache.cassandra.thrift.SliceRange createSliceRange(com.netflix.astyanax.Serializer<C> serializer,
C startColumn,
C endColumn,
boolean reversed,
int limit)
getPropertiesFromThrift
public static <T extends org.apache.thrift.TBase> java.util.Properties getPropertiesFromThrift(T entity)
throws java.lang.Exception
- Throws:
java.lang.Exception
setPropertiesFromThrift
public static void setPropertiesFromThrift(java.lang.String prefix,
java.util.Properties properties,
org.apache.thrift.TBase entity)
throws java.lang.Exception
- Quick and dirty implementation that converts thrift DDL to a Properties object by flattening
the parameters
- Parameters:
prefix - properties - entity -
- Throws:
java.lang.Exception
getThriftObjectFromProperties
public static <T> T getThriftObjectFromProperties(java.lang.Class<T> clazz,
java.util.Properties props)
throws java.lang.Exception
- Throws:
java.lang.Exception
populateObjectFromProperties
public static java.lang.Object populateObjectFromProperties(java.lang.Object entity,
java.util.Properties props)
throws java.lang.Exception
- Throws:
java.lang.Exception
valueForBasicType
public static java.lang.Object valueForBasicType(java.lang.Object value,
byte type)
propertiesToMap
public static java.util.Map<java.lang.String,java.lang.Object> propertiesToMap(java.util.Properties props)
- Convert a Properties object into a tree
- Parameters:
props -
- Returns: