diff options
| author | Michael Williamson <mike@zwobble.org> | 2015-10-06 11:02:51 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2015-10-06 11:02:51 +0100 |
| commit | 56470c01483077849dae33f65364bad987afac7a (patch) | |
| tree | 2954d1d44f6c11a6c27299496014b0723e7d6e8d /src/main/java/org/zwobble/couscous/backends/python/PrimitiveMethods.java | |
| parent | a7669795d1d58e4962f16272cb5e92783cf01c64 (diff) | |
Combine type reference and class name into type name
Diffstat (limited to 'src/main/java/org/zwobble/couscous/backends/python/PrimitiveMethods.java')
| -rw-r--r-- | src/main/java/org/zwobble/couscous/backends/python/PrimitiveMethods.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main/java/org/zwobble/couscous/backends/python/PrimitiveMethods.java b/src/main/java/org/zwobble/couscous/backends/python/PrimitiveMethods.java index 67f66ea..02db3b2 100644 --- a/src/main/java/org/zwobble/couscous/backends/python/PrimitiveMethods.java +++ b/src/main/java/org/zwobble/couscous/backends/python/PrimitiveMethods.java @@ -4,9 +4,9 @@ import java.util.List; import java.util.Map; import java.util.Optional; +import org.zwobble.couscous.ast.TypeName; import org.zwobble.couscous.backends.python.ast.PythonExpressionNode; import org.zwobble.couscous.values.StringValue; -import org.zwobble.couscous.values.TypeReference; import com.google.common.collect.ImmutableMap; @@ -29,16 +29,16 @@ public class PrimitiveMethods { .build(); - private static final Map<TypeReference, Map<String, PrimitiveMethodGenerator>> METHODS = - ImmutableMap.<TypeReference, Map<String, PrimitiveMethodGenerator>>builder() + private static final Map<TypeName, Map<String, PrimitiveMethodGenerator>> METHODS = + ImmutableMap.<TypeName, Map<String, PrimitiveMethodGenerator>>builder() .put(StringValue.REF, STRING_METHODS) .build(); - public static boolean isPrimitive(TypeReference type) { + public static boolean isPrimitive(TypeName type) { return METHODS.containsKey(type); } - public static Optional<PrimitiveMethodGenerator> getPrimitiveMethod(TypeReference type, String methodName) { + public static Optional<PrimitiveMethodGenerator> getPrimitiveMethod(TypeName type, String methodName) { return Optional.ofNullable(METHODS.get(type)) .flatMap(methodsForType -> Optional.ofNullable(methodsForType.get(methodName))); } |
