[RocksJava] Raw use of parametrized class

Resolved raw use of parametrized class issues.
main
fyrz 10 years ago
parent 5d1151deba
commit 6a0e737d9d
  1. 2
      java/src/main/java/org/rocksdb/AbstractComparator.java
  2. 6
      java/src/main/java/org/rocksdb/AbstractSlice.java
  3. 5
      java/src/main/java/org/rocksdb/ColumnFamilyOptions.java
  4. 2
      java/src/main/java/org/rocksdb/ColumnFamilyOptionsInterface.java
  5. 5
      java/src/main/java/org/rocksdb/Options.java
  6. 4
      java/src/main/java/org/rocksdb/WriteBatchWithIndex.java

@ -14,7 +14,7 @@ package org.rocksdb;
* @see org.rocksdb.Comparator * @see org.rocksdb.Comparator
* @see org.rocksdb.DirectComparator * @see org.rocksdb.DirectComparator
*/ */
public abstract class AbstractComparator<T extends AbstractSlice> public abstract class AbstractComparator<T extends AbstractSlice<?>>
extends RocksObject { extends RocksObject {
/** /**

@ -99,7 +99,7 @@ abstract class AbstractSlice<T> extends RocksObject {
* 2) == 0 if this == other * 2) == 0 if this == other
* 3) &gt; 0 if this &gt; other * 3) &gt; 0 if this &gt; other
*/ */
public int compare(final AbstractSlice other) { public int compare(final AbstractSlice<?> other) {
assert (other != null); assert (other != null);
assert (isInitialized()); assert (isInitialized());
return compare0(nativeHandle_, other.nativeHandle_); return compare0(nativeHandle_, other.nativeHandle_);
@ -118,7 +118,7 @@ abstract class AbstractSlice<T> extends RocksObject {
@Override @Override
public boolean equals(final Object other) { public boolean equals(final Object other) {
if (other != null && other instanceof AbstractSlice) { if (other != null && other instanceof AbstractSlice) {
return compare((AbstractSlice)other) == 0; return compare((AbstractSlice<?>)other) == 0;
} else { } else {
return false; return false;
} }
@ -134,7 +134,7 @@ abstract class AbstractSlice<T> extends RocksObject {
* @return true when this slice starts with the * @return true when this slice starts with the
* {@code prefix} slice * {@code prefix} slice
*/ */
public boolean startsWith(final AbstractSlice prefix) { public boolean startsWith(final AbstractSlice<?> prefix) {
if (prefix != null) { if (prefix != null) {
assert (isInitialized()); assert (isInitialized());
return startsWith0(nativeHandle_, prefix.nativeHandle_); return startsWith0(nativeHandle_, prefix.nativeHandle_);

@ -118,7 +118,8 @@ public class ColumnFamilyOptions extends RocksObject
} }
@Override @Override
public ColumnFamilyOptions setComparator(AbstractComparator comparator) { public ColumnFamilyOptions setComparator(
AbstractComparator<? extends AbstractSlice<?>> comparator) {
assert (isInitialized()); assert (isInitialized());
setComparatorHandle(nativeHandle_, comparator.nativeHandle_); setComparatorHandle(nativeHandle_, comparator.nativeHandle_);
comparator_ = comparator; comparator_ = comparator;
@ -705,5 +706,5 @@ public class ColumnFamilyOptions extends RocksObject
MemTableConfig memTableConfig_; MemTableConfig memTableConfig_;
TableFormatConfig tableFormatConfig_; TableFormatConfig tableFormatConfig_;
AbstractComparator comparator_; AbstractComparator<? extends AbstractSlice<?>> comparator_;
} }

@ -109,7 +109,7 @@ public interface ColumnFamilyOptionsInterface {
* @param comparator java instance. * @param comparator java instance.
* @return the instance of the current Object. * @return the instance of the current Object.
*/ */
Object setComparator(AbstractComparator comparator); Object setComparator(AbstractComparator<? extends AbstractSlice<?>> comparator);
/** /**
* <p>Set the merge operator to be used for merging two merge operands * <p>Set the merge operator to be used for merging two merge operands

@ -163,7 +163,8 @@ public class Options extends RocksObject
} }
@Override @Override
public Options setComparator(AbstractComparator comparator) { public Options setComparator(
AbstractComparator<? extends AbstractSlice<?>> comparator) {
assert (isInitialized()); assert (isInitialized());
setComparatorHandle(nativeHandle_, comparator.nativeHandle_); setComparatorHandle(nativeHandle_, comparator.nativeHandle_);
comparator_ = comparator; comparator_ = comparator;
@ -1253,5 +1254,5 @@ public class Options extends RocksObject
MemTableConfig memTableConfig_; MemTableConfig memTableConfig_;
TableFormatConfig tableFormatConfig_; TableFormatConfig tableFormatConfig_;
RateLimiterConfig rateLimiterConfig_; RateLimiterConfig rateLimiterConfig_;
AbstractComparator comparator_; AbstractComparator<? extends AbstractSlice<?>> comparator_;
} }

@ -58,8 +58,8 @@ public class WriteBatchWithIndex extends AbstractWriteBatch {
* inserting a duplicate key, in this way an iterator will never * inserting a duplicate key, in this way an iterator will never
* show two entries with the same key. * show two entries with the same key.
*/ */
public WriteBatchWithIndex(AbstractComparator fallbackIndexComparator, int reservedBytes, public WriteBatchWithIndex(AbstractComparator<? extends AbstractSlice<?>>
boolean overwriteKey) { fallbackIndexComparator, int reservedBytes, boolean overwriteKey) {
super(); super();
newWriteBatchWithIndex(fallbackIndexComparator.nativeHandle_, reservedBytes, overwriteKey); newWriteBatchWithIndex(fallbackIndexComparator.nativeHandle_, reservedBytes, overwriteKey);
} }

Loading…
Cancel
Save