Skip to content

Commit

Permalink
Add type parameter names to SimplePropertyMetaDataImpl
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillvasilenko authored Mar 11, 2024
1 parent 24b8d7e commit 66b098d
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,42 @@

import org.jetbrains.annotations.Nullable;

import java.util.Collections;
import java.util.List;

/**
*/
public class SimplePropertyMetaDataImpl extends PropertyMetaDataImpl {

private String primitiveTypeName;

private List<String> typeParameterNames;

public SimplePropertyMetaDataImpl() {
}

public SimplePropertyMetaDataImpl(final String name, final String primitiveTypeName) {
this(name, primitiveTypeName, Collections.emptyList());
}

public SimplePropertyMetaDataImpl(final String name, final String primitiveTypeName, final List<String> typeParameterNames) {
super(name, PropertyType.PRIMITIVE);
this.primitiveTypeName = primitiveTypeName;
this.typeParameterNames = typeParameterNames;
}

@Nullable
public String getPrimitiveTypeName() {
return primitiveTypeName;
}

/**
* If you have a property of type Set[String], String is the type parameter.
* So, getPrimitiveTypeName() returns "Set" and getTypeParameterNames() returns ["String"].
* */
@Nullable
public List<String> getTypeParameterNames() { return typeParameterNames; }

public void setPrimitiveTypeName(String primitiveTypeName) {
this.primitiveTypeName = primitiveTypeName;
}
Expand Down

0 comments on commit 66b098d

Please sign in to comment.