Class: HBase::ColumnKey
- Inherits:
-
Object
- Object
- HBase::ColumnKey
- Defined in:
- lib/hbase-jruby/column_key.rb
Overview
@return [String] The column family
Instance Attribute Summary collapse
-
#cf ⇒ Object
(also: #family)
readonly
Returns the value of attribute cf.
Instance Method Summary collapse
-
#<=>(other) ⇒ Object
Compares two ColumnKeys.
-
#cq(type = :string) ⇒ Object
(also: #qualifier)
Returns the column qualifer decoded as the given type.
-
#eql?(other) ⇒ Boolean
(also: #==)
Checks whether if the two ColumnKeys are equal.
-
#hash ⇒ Fixnum
Returns a hash number for this ColumnKey.
-
#initialize(cf, cq) ⇒ ColumnKey
constructor
Creates a ColumnKey object.
-
#to_s ⇒ String
Returns String representation of the column key (Qualifier decoded as a String).
Constructor Details
Instance Attribute Details
#cf ⇒ Object (readonly) Also known as: family
Returns the value of attribute cf.
14 15 16 |
# File 'lib/hbase-jruby/column_key.rb', line 14 def cf @cf end |
Instance Method Details
#<=>(other) ⇒ Object
Compares two ColumnKeys
42 43 44 45 46 |
# File 'lib/hbase-jruby/column_key.rb', line 42 def <=> other other = other_as_ck(other) d = @cf <=> other.cf d != 0 ? d : Bytes.compareTo(@cq, other.cq(:raw)) end |
#cq(type = :string) ⇒ Object Also known as: qualifier
Returns the column qualifer decoded as the given type
27 28 29 |
# File 'lib/hbase-jruby/column_key.rb', line 27 def cq type = :string Util.from_bytes type, @cq end |
#eql?(other) ⇒ Boolean Also known as: ==
Checks whether if the two ColumnKeys are equal
34 35 36 37 |
# File 'lib/hbase-jruby/column_key.rb', line 34 def eql? other other = other_as_ck(other) @cf == other.cf && Arrays.equals(@cq, other.cq(:raw)) end |
#hash ⇒ Fixnum
Returns a hash number for this ColumnKey
50 51 52 |
# File 'lib/hbase-jruby/column_key.rb', line 50 def hash [@cf, Arrays.java_send(:hashCode, [Util::JAVA_BYTE_ARRAY_CLASS], @cq)].hash end |
#to_s ⇒ String
Returns String representation of the column key (Qualifier decoded as a String)
56 57 58 |
# File 'lib/hbase-jruby/column_key.rb', line 56 def to_s [@cf, @cq.empty? ? nil : cq].compact.join(':') end |