Skip to content

Added asFloat and fixed a type LongHander --> LongHandler #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 5, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 27 additions & 3 deletions src/main/java/io/dinject/javalin/generator/TypeMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ private static void add(TypeHandler h) {
static {
types.put("int", new IntHandler());
types.put("long", new PLongHandler());
types.put("float", new PFloatHandler());
types.put("boolean", new BoolHandler());

types.put("java.lang.String", new StringHandler());
types.put("java.lang.Integer", new IntegerHandler());
types.put("java.lang.Long", new LongHander());
types.put("java.lang.Long", new LongHandler());
types.put("java.lang.Float", new FloatHandler());
types.put("java.lang.Boolean", new BooleanHandler());

add(new UuidHandler());
Expand Down Expand Up @@ -77,8 +79,8 @@ static class IntHandler extends Primitive {
}
}

static class LongHander extends JavaLangType {
LongHander() {
static class LongHandler extends JavaLangType {
LongHandler() {
super("Long");
}

Expand All @@ -99,6 +101,28 @@ static class PLongHandler extends Primitive {
}
}

static class FloatHandler extends JavaLangType {
FloatHandler() {
super("Float");
}

@Override
public String asMethod() {
return "asFloat(";
}

@Override
public String toMethod() {
return "toFloat(";
}
}

static class PFloatHandler extends Primitive {
PFloatHandler() {
super("Float");
}
}

static class BooleanHandler extends JavaLangType {
BooleanHandler() {
super("Boolean");
Expand Down