do string compression in StringCompressor instead of Tag
This commit is contained in:
@@ -39,4 +39,16 @@ public class StringCompressor {
|
||||
return integer != null ? integer : -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new {@link Tag} for the given field and value.
|
||||
*
|
||||
* @param field the field
|
||||
* @param value the value
|
||||
*/
|
||||
public Tag createTag(final String field, final String value) {
|
||||
final int f = field != null ? Tags.STRING_COMPRESSOR.getIfPresent(field) : -1;
|
||||
final int v = value != null ? Tags.STRING_COMPRESSOR.getIfPresent(value) : -1;
|
||||
return new Tag(f, v);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -22,17 +22,6 @@ public class Tag implements Comparable<Tag> {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new {@link Tag} for the given field and value.
|
||||
*
|
||||
* @param field the field
|
||||
* @param value the value
|
||||
*/
|
||||
public Tag(final String field, final String value) {
|
||||
this.field = field != null ? Tags.STRING_COMPRESSOR.getIfPresent(field) : -1;
|
||||
this.value = value != null ? Tags.STRING_COMPRESSOR.getIfPresent(value) : -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(final Tag o) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user