Skip to content

Commit

Permalink
Fix @ArtDu comments
Browse files Browse the repository at this point in the history
  • Loading branch information
iDneprov committed Jun 7, 2023
1 parent aee4ded commit 6e89982
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* @author Sergey Volgin
*/
public interface TarantoolIndexPartMetadata {
public interface TarantoolIndexPartMetadata<T> {
/**
* Get field index in space format
*
Expand All @@ -25,5 +25,5 @@ public interface TarantoolIndexPartMetadata {
*
* @return path inside field (may be null)
*/
Object getPath();
T getPath();
}
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ private Map<String, TarantoolIndexMetadata> parseIndexes(
}
String fieldType = fieldTypeValue.asStringValue().asString();

return new TarantoolIndexPartMetadataImpl(fieldNumber, fieldType, fieldPath);
return new TarantoolIndexPartMetadataImpl<>(fieldNumber, fieldType, fieldPath);
})
.collect(Collectors.toList());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ public TarantoolIndexMetadata fromValue(ArrayValue value) {
if (indexPartsValue.size() > 0) {
if (indexPartsValue.get(0).isArrayValue()) {
indexParts = indexPartsValue.list().stream()
.map(partValue -> new TarantoolIndexPartMetadataImpl(
.map(partValue -> new TarantoolIndexPartMetadataImpl<>(
partValue.asArrayValue().get(0).asIntegerValue().asInt(),
partValue.asArrayValue().get(1).asStringValue().asString()
)).collect(Collectors.toList());
} else {
indexParts = indexPartsValue.list().stream()
.map(partValue -> new TarantoolIndexPartMetadataImpl(
.map(partValue -> new TarantoolIndexPartMetadataImpl<>(
partValue.asMapValue().map().get(INDEX_FIELD_KEY).asIntegerValue().asInt(),
partValue.asMapValue().map().get(INDEX_TYPE_KEY).asStringValue().asString()
)).collect(Collectors.toList());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
*
* @author Sergey Volgin
*/
class TarantoolIndexPartMetadataImpl implements TarantoolIndexPartMetadata {
class TarantoolIndexPartMetadataImpl<T> implements TarantoolIndexPartMetadata {

private final int fieldIndex;
private final String fieldType;
private final Object path;
private final T path;

TarantoolIndexPartMetadataImpl(int fieldIndex, String fieldType) {
this(fieldIndex, fieldType, null);
}

TarantoolIndexPartMetadataImpl(int fieldIndex, String fieldType, Object path) {
TarantoolIndexPartMetadataImpl(int fieldIndex, String fieldType, T path) {
this.fieldIndex = fieldIndex;
this.fieldType = fieldType;
this.path = path;
Expand All @@ -34,7 +34,7 @@ public String getFieldType() {
}

@Override
public Object getPath() {
public T getPath() {
return path;
}
}
2 changes: 1 addition & 1 deletion src/test/resources/cartridge/app/roles/api_storage.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ local function init_space()
}
)

test_space:create_index('id', { parts = { 'id' }, if_not_exists = true, })
test_space:create_index('id', { parts = { 1 }, if_not_exists = true, })
test_space:create_index('bucket_id', { parts = { 'bucket_id' }, unique = false, if_not_exists = true, })

local second_test_space = box.schema.space.create(
Expand Down

0 comments on commit 6e89982

Please sign in to comment.