Skip to content

Commit fc0c366

Browse files
committed
Text API
1 parent d2b9895 commit fc0c366

22 files changed

+683
-20
lines changed

build.gradle

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
apply plugin: 'maven'
66

77
group 'ru.redguy'
8-
version '1.1.1'
8+
version '1.1.2'
99

1010
repositories {
1111
maven {
@@ -19,6 +19,11 @@ dependencies {
1919
implementation 'com.google.code.gson:gson:2.8.8'
2020
}
2121

22+
//utf-8
23+
tasks.withType(JavaCompile) {
24+
options.encoding = "UTF-8"
25+
}
26+
2227
uploadArchives {
2328
repositories {
2429
mavenDeployer {
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package ru.redguy.redguyapi.text;
2+
3+
import ru.redguy.redguyapi.utils.ToStringBuilder;
4+
5+
public class AmountOfMoneyEntity extends TextEntity {
6+
public static class Value {
7+
private int value;
8+
private String type;
9+
private String unit;
10+
11+
public int getValue() {
12+
return value;
13+
}
14+
15+
public String getType() {
16+
return type;
17+
}
18+
19+
public String getUnit() {
20+
return unit;
21+
}
22+
23+
@Override
24+
public String toString() {
25+
return ToStringBuilder.of(this);
26+
}
27+
}
28+
29+
private Value value;
30+
31+
public Value getValue() {
32+
return value;
33+
}
34+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package ru.redguy.redguyapi.text;
2+
3+
import ru.redguy.redguyapi.utils.ToStringBuilder;
4+
5+
public class CreditCardNumberEntity extends TextEntity {
6+
public static class Value {
7+
private String value;
8+
private String issuer;
9+
10+
public String getValue() {
11+
return value;
12+
}
13+
14+
public String getIssuer() {
15+
return issuer;
16+
}
17+
18+
@Override
19+
public String toString() {
20+
return ToStringBuilder.of(this);
21+
}
22+
}
23+
24+
private Value value;
25+
26+
public Value getValue() {
27+
return value;
28+
}
29+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package ru.redguy.redguyapi.text;
2+
3+
import ru.redguy.redguyapi.utils.ToStringBuilder;
4+
5+
public class DistanceEntity extends TextEntity {
6+
public static class Value {
7+
private int value;
8+
private String type;
9+
private String unit;
10+
11+
public int getValue() {
12+
return value;
13+
}
14+
15+
public String getType() {
16+
return type;
17+
}
18+
19+
public String getUnit() {
20+
return unit;
21+
}
22+
23+
@Override
24+
public String toString() {
25+
return ToStringBuilder.of(this);
26+
}
27+
}
28+
29+
private Value value;
30+
31+
public Value getValue() {
32+
return value;
33+
}
34+
}
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
package ru.redguy.redguyapi.text;
2+
3+
import org.jetbrains.annotations.Nullable;
4+
import ru.redguy.redguyapi.utils.ToStringBuilder;
5+
6+
public class DurationEntity extends TextEntity {
7+
public static class Value {
8+
private int value;
9+
private String type;
10+
private @Nullable Integer second;
11+
private @Nullable Integer minute;
12+
private @Nullable Integer hour;
13+
private @Nullable Integer day;
14+
private @Nullable Integer week;
15+
private @Nullable Integer month;
16+
private @Nullable Integer year;
17+
private String unit;
18+
private NormalizedValue normalized;
19+
20+
public int getValue() {
21+
return value;
22+
}
23+
24+
public String getType() {
25+
return type;
26+
}
27+
28+
public String getUnit() {
29+
return unit;
30+
}
31+
32+
@Nullable
33+
public Integer getMinute() {
34+
return minute;
35+
}
36+
37+
@Nullable
38+
public Integer getSecond() {
39+
return second;
40+
}
41+
42+
@Nullable
43+
public Integer getHour() {
44+
return hour;
45+
}
46+
47+
@Nullable
48+
public Integer getDay() {
49+
return day;
50+
}
51+
52+
@Nullable
53+
public Integer getWeek() {
54+
return week;
55+
}
56+
57+
@Nullable
58+
public Integer getMonth() {
59+
return month;
60+
}
61+
62+
@Nullable
63+
public Integer getYear() {
64+
return year;
65+
}
66+
67+
public NormalizedValue getNormalized() {
68+
return normalized;
69+
}
70+
71+
@Override
72+
public String toString() {
73+
return ToStringBuilder.of(this);
74+
}
75+
}
76+
77+
public static class NormalizedValue {
78+
private long value;
79+
private String unit;
80+
81+
public long getValue() {
82+
return value;
83+
}
84+
85+
public String getUnit() {
86+
return unit;
87+
}
88+
89+
@Override
90+
public String toString() {
91+
return ToStringBuilder.of(this);
92+
}
93+
}
94+
95+
private Value value;
96+
97+
public Value getValue() {
98+
return value;
99+
}
100+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package ru.redguy.redguyapi.text;
2+
3+
import ru.redguy.redguyapi.utils.ToStringBuilder;
4+
5+
public class EmailEntity extends TextEntity {
6+
public static class Value {
7+
private long value;
8+
private String type;
9+
10+
public long getValue() {
11+
return value;
12+
}
13+
14+
public String getType() {
15+
return type;
16+
}
17+
18+
@Override
19+
public String toString() {
20+
return ToStringBuilder.of(this);
21+
}
22+
}
23+
24+
private Value value;
25+
26+
public Value getValue() {
27+
return value;
28+
}
29+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package ru.redguy.redguyapi.text;
2+
3+
import ru.redguy.redguyapi.utils.ToStringBuilder;
4+
5+
public class NumberEntity extends TextEntity {
6+
public static class Value {
7+
private long value;
8+
private String type;
9+
10+
public long getValue() {
11+
return value;
12+
}
13+
14+
public String getType() {
15+
return type;
16+
}
17+
18+
@Override
19+
public String toString() {
20+
return ToStringBuilder.of(this);
21+
}
22+
}
23+
24+
private Value value;
25+
26+
public Value getValue() {
27+
return value;
28+
}
29+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package ru.redguy.redguyapi.text;
2+
3+
import ru.redguy.redguyapi.utils.ToStringBuilder;
4+
5+
public class OrdinalEntity extends TextEntity {
6+
public static class Value {
7+
private long value;
8+
private String type;
9+
10+
public long getValue() {
11+
return value;
12+
}
13+
14+
public String getType() {
15+
return type;
16+
}
17+
18+
@Override
19+
public String toString() {
20+
return ToStringBuilder.of(this);
21+
}
22+
}
23+
24+
private Value value;
25+
26+
public Value getValue() {
27+
return value;
28+
}
29+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package ru.redguy.redguyapi.text;
2+
3+
import ru.redguy.redguyapi.utils.ToStringBuilder;
4+
5+
public class PhoneNumberEntity extends TextEntity {
6+
public static class Value {
7+
private String value;
8+
private String type;
9+
10+
public String getValue() {
11+
return value;
12+
}
13+
14+
public String getType() {
15+
return type;
16+
}
17+
18+
@Override
19+
public String toString() {
20+
return ToStringBuilder.of(this);
21+
}
22+
}
23+
24+
private Value value;
25+
26+
public Value getValue() {
27+
return value;
28+
}
29+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package ru.redguy.redguyapi.text;
2+
3+
import ru.redguy.redguyapi.utils.ToStringBuilder;
4+
5+
public class QuantityEntity extends TextEntity {
6+
public static class Value {
7+
private long value;
8+
private String type;
9+
private String product;
10+
private String unit;
11+
12+
public long getValue() {
13+
return value;
14+
}
15+
16+
public String getType() {
17+
return type;
18+
}
19+
20+
public String getProduct() {
21+
return product;
22+
}
23+
24+
public String getUnit() {
25+
return unit;
26+
}
27+
28+
@Override
29+
public String toString() {
30+
return ToStringBuilder.of(this);
31+
}
32+
}
33+
34+
private Value value;
35+
36+
public Value getValue() {
37+
return value;
38+
}
39+
}

0 commit comments

Comments
 (0)