Class: HBase::ColumnKey
- Inherits:
-
Object
- Object
- HBase::ColumnKey
- Defined in:
- lib/hbase-jruby/column_key.rb
Overview
Boxed class for column keys
Instance Attribute Summary collapse
-
#cf ⇒ Object
(also: #family)
readonly
Returns the value of attribute cf.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #cq(type = :string) ⇒ Object (also: #qualifier)
- #eql?(other) ⇒ Boolean (also: #==)
- #hash ⇒ Object
-
#initialize(cf, cq) ⇒ ColumnKey
constructor
Creates a ColumnKey object.
- #to_s ⇒ Object
Constructor Details
Instance Attribute Details
#cf ⇒ Object (readonly) Also known as: family
Returns the value of attribute cf.
12 13 14 |
# File 'lib/hbase-jruby/column_key.rb', line 12 def cf @cf end |
Instance Method Details
#<=>(other) ⇒ Object
37 38 39 40 41 |
# File 'lib/hbase-jruby/column_key.rb', line 37 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
24 25 26 |
# File 'lib/hbase-jruby/column_key.rb', line 24 def cq type = :string Util.from_bytes type, @cq end |
#eql?(other) ⇒ Boolean Also known as: ==
30 31 32 33 |
# File 'lib/hbase-jruby/column_key.rb', line 30 def eql? other other = other_as_ck(other) @cf == other.cf && Arrays.equals(@cq, other.cq(:raw)) end |
#hash ⇒ Object
43 44 45 |
# File 'lib/hbase-jruby/column_key.rb', line 43 def hash [@cf, Arrays.java_send(:hashCode, [Util::JAVA_BYTE_ARRAY_CLASS], @cq)].hash end |
#to_s ⇒ Object
47 48 49 |
# File 'lib/hbase-jruby/column_key.rb', line 47 def to_s [@cf, @cq.empty? ? nil : cq].compact.join(':') end |