类 AttributeValue
- java.lang.Object
-
- com.baidubce.services.moladb.model.AttributeValue
-
public class AttributeValue extends Object
Represents the value for an attribute.
-
-
字段概要
字段 修饰符和类型 字段 说明 static StringATTRIBUTE_TYPE_BINARYstatic StringATTRIBUTE_TYPE_NUMBERstatic StringATTRIBUTE_TYPE_STRING
-
构造器概要
构造器 构造器 说明 AttributeValue()Constructs a new AttributeValue object.AttributeValue(byte[] buffer)Constructs a new AttributeValue object and init the value type as BinaryAttributeValue(double d)Constructs a new AttributeValue object and init the value type as NumberAttributeValue(long n)Constructs a new AttributeValue object and init the value type as NumberAttributeValue(String s)Constructs a new AttributeValue object and init the value type as String
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 StringgetAttributeType()The method return the attribute value type.StringgetAttributeValue()The method return the attribute value.byte[]getB()The method return the attribute value in byte array.doublegetDouble()The method return the attribute value in Double.longgetLong()The method return the attribute value in Long.StringgetN()The method return the attribute value in String.StringgetS()The method return the attribute value in String.voidsetB(byte[] buffer)The method set value type as binary and set the value with input parameter.voidsetN(double n)The method set value type as number and set the value with input parameter.voidsetN(long n)The method set value type as number and set the value with input parameter.voidsetN(String n)The method set value type as number and set the value with input parameter.voidsetS(String s)The method set value type as String and set the value with input parameter.voidsetValue(String type, String value)The method set value type and value with input parameter.protected Map<String,String>toJsonObj()StringtoString()Return a string representation of the object.AttributeValuewithB(byte[] buffer)The method set value type as binary and set the value with input parameter.AttributeValuewithN(double n)The method set value type as number and set the value with input parameter.AttributeValuewithN(long n)The method set value type as number and set the value with input parameter.AttributeValuewithN(String n)The method set value type as number and set the value with input parameter.AttributeValuewithS(String s)The method set value type as String and set the value with input parameter.
-
-
-
构造器详细资料
-
AttributeValue
public AttributeValue()
Constructs a new AttributeValue object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.
-
AttributeValue
public AttributeValue(String s)
Constructs a new AttributeValue object and init the value type as String- 参数:
s- The initial value of AttributeValue
-
AttributeValue
public AttributeValue(double d)
Constructs a new AttributeValue object and init the value type as Number- 参数:
d- The initial value of AttributeValue
-
AttributeValue
public AttributeValue(long n)
Constructs a new AttributeValue object and init the value type as Number- 参数:
n- The initial value of AttributeValue
-
AttributeValue
public AttributeValue(byte[] buffer)
Constructs a new AttributeValue object and init the value type as Binary- 参数:
buffer- The input byte buffer for AttributeValue
-
-
方法详细资料
-
getB
public byte[] getB()
The method return the attribute value in byte array. Note: This method will decode the attribute value with base64 first.- 返回:
- Attribute value in byte array.
-
withB
public AttributeValue withB(byte[] buffer)
The method set value type as binary and set the value with input parameter. Input byte array will be encoded with base64. a reference to this object so that method calls can be chained together.- 参数:
buffer- The value to be set.- 返回:
- A reference to this object so that method calls can be chained together
-
setB
public void setB(byte[] buffer)
The method set value type as binary and set the value with input parameter. Note: this method will encode the byte array with base64 first.- 参数:
buffer- The value to be set.
-
getN
public String getN()
The method return the attribute value in String.- 返回:
- Attribute value in String.
-
getLong
public long getLong()
The method return the attribute value in Long.- 返回:
- Attribute value in long.
-
getDouble
public double getDouble()
The method return the attribute value in Double.- 返回:
- Attribute value in double.
-
withN
public AttributeValue withN(String n)
The method set value type as number and set the value with input parameter.- 参数:
n- The value to be set.- 返回:
- A reference to this object so that method calls can be chained together
-
withN
public AttributeValue withN(long n)
The method set value type as number and set the value with input parameter.- 参数:
n- The value to be set.- 返回:
- A reference to this object so that method calls can be chained together
-
withN
public AttributeValue withN(double n)
The method set value type as number and set the value with input parameter.- 参数:
n- The value to be set.- 返回:
- A reference to this object so that method calls can be chained together
-
setN
public void setN(String n)
The method set value type as number and set the value with input parameter.- 参数:
n- The value to be set.
-
setN
public void setN(long n)
The method set value type as number and set the value with input parameter.- 参数:
n- The value to be set.
-
setN
public void setN(double n)
The method set value type as number and set the value with input parameter.- 参数:
n- The value to be set.
-
getS
public String getS()
The method return the attribute value in String.- 返回:
- The attribute value in String.
-
withS
public AttributeValue withS(String s)
The method set value type as String and set the value with input parameter.- 参数:
s- The value to be set.- 返回:
- A reference to this object so that method calls can be chained together
-
setS
public void setS(String s)
The method set value type as String and set the value with input parameter.- 参数:
s- The value to be set.
-
getAttributeType
public String getAttributeType()
The method return the attribute value type.- 返回:
- Attribute value type.
-
getAttributeValue
public String getAttributeValue()
The method return the attribute value.- 返回:
- Attribute value type.
-
toString
public String toString()
Return a string representation of the object.
-
setValue
public void setValue(String type, String value)
The method set value type and value with input parameter. If type is "B" (binary), the corresponding value MUST be encoded with base64.- 参数:
type- The attribute type to be set.value- The value to be set.
-
-