Skip to content

Commit d67f81e

Browse files
committed
Remove Lombok dependency from pom
1 parent 1487a8e commit d67f81e

File tree

42 files changed

+825
-325
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+825
-325
lines changed

java-custom-validation/src/main/java/com/froyo/AppCustomValidation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.froyo;
22

33
import com.froyo.model.dto.TripDTO;
4-
import lombok.extern.java.Log;
4+
import java.util.logging.Logger;
55

66
public class AppCustomValidation {
77

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,28 @@
11
package com.froyo.model.dto;
22

33
import com.froyo.customvalidation.constraints.AirlineConstraint;
4-
import lombok.AllArgsConstructor;
5-
import lombok.Data;
6-
74
import jakarta.validation.constraints.NotNull;
85

9-
@AllArgsConstructor
10-
@Data
116
public class TripDTO {
127

138
@NotNull
149
@AirlineConstraint
1510
private String airline;
1611

12+
public TripDTO(String airline) {
13+
this.airline = airline;
14+
}
15+
16+
public String getAirline() {
17+
return airline;
18+
}
19+
20+
public void setAirline(String airline) {
21+
this.airline = airline;
22+
}
23+
24+
@Override
25+
public String toString() {
26+
return "TripDTO(airline=" + this.airline + ")";
27+
}
1728
}
Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
package designpatterns.behavioral.command;
22

3-
import lombok.AllArgsConstructor;
4-
import lombok.Getter;
5-
63
import java.math.BigDecimal;
74

8-
@Getter
9-
@AllArgsConstructor
105
public class SaldoFamiliar {
11-
126
private BigDecimal saldo;
137

148
public void ingreso(BigDecimal monto) {
@@ -21,4 +15,13 @@ public void gasto(BigDecimal monto) {
2115
System.out.println("gasto: " + this.saldo);
2216
}
2317

18+
@java.lang.SuppressWarnings("all")
19+
public BigDecimal getSaldo() {
20+
return this.saldo;
21+
}
22+
23+
@java.lang.SuppressWarnings("all")
24+
public SaldoFamiliar(final BigDecimal saldo) {
25+
this.saldo = saldo;
26+
}
2427
}
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
package designpatterns.behavioral.command;
22

3-
import lombok.AllArgsConstructor;
4-
53
import java.math.BigDecimal;
64

7-
@AllArgsConstructor
85
public class SaldoGastoServiceImpl implements SaldoFamiliarService {
9-
106
private SaldoFamiliar saldoFamiliar;
117
private BigDecimal monto;
128

139
public void execute() {
1410
this.saldoFamiliar.gasto(this.monto);
1511
}
1612

13+
@java.lang.SuppressWarnings("all")
14+
public SaldoGastoServiceImpl(final SaldoFamiliar saldoFamiliar, final BigDecimal monto) {
15+
this.saldoFamiliar = saldoFamiliar;
16+
this.monto = monto;
17+
}
1718
}
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
package designpatterns.behavioral.command;
22

3-
import lombok.AllArgsConstructor;
4-
53
import java.math.BigDecimal;
64

7-
@AllArgsConstructor
85
public class SaldoIngresoServiceImpl implements SaldoFamiliarService {
9-
106
private SaldoFamiliar saldoFamiliar;
117
private BigDecimal monto;
128

139
public void execute() {
1410
this.saldoFamiliar.ingreso(this.monto);
1511
}
1612

13+
@java.lang.SuppressWarnings("all")
14+
public SaldoIngresoServiceImpl(final SaldoFamiliar saldoFamiliar, final BigDecimal monto) {
15+
this.saldoFamiliar = saldoFamiliar;
16+
this.monto = monto;
17+
}
1718
}
Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
package designpatterns.behavioral.memento;
22

3-
import lombok.AllArgsConstructor;
4-
import lombok.ToString;
5-
6-
@ToString
7-
@AllArgsConstructor
83
public class Juego {
9-
104
private String nombre;
115
private int checkpoint;
126

7+
@java.lang.Override
8+
@java.lang.SuppressWarnings("all")
9+
public java.lang.String toString() {
10+
return "Juego(nombre=" + this.nombre + ", checkpoint=" + this.checkpoint + ")";
11+
}
12+
13+
@java.lang.SuppressWarnings("all")
14+
public Juego(final String nombre, final int checkpoint) {
15+
this.nombre = nombre;
16+
this.checkpoint = checkpoint;
17+
}
1318
}
Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
package designpatterns.behavioral.memento;
22

3-
import lombok.AllArgsConstructor;
4-
import lombok.Getter;
5-
6-
@Getter
7-
@AllArgsConstructor
83
public class Memento {
9-
104
private Juego estado;
115

6+
@java.lang.SuppressWarnings("all")
7+
public Juego getEstado() {
8+
return this.estado;
9+
}
10+
11+
@java.lang.SuppressWarnings("all")
12+
public Memento(final Juego estado) {
13+
this.estado = estado;
14+
}
1215
}
Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
package designpatterns.behavioral.memento;
22

3-
import lombok.Data;
4-
5-
@Data
63
public class Originator {
7-
84
private Juego estado;
95

106
public Memento guardar() {
@@ -15,4 +11,51 @@ public void restaurar(Memento m) {
1511
this.estado = m.getEstado();
1612
}
1713

14+
@java.lang.SuppressWarnings("all")
15+
public Originator() {
16+
}
17+
18+
@java.lang.SuppressWarnings("all")
19+
public Juego getEstado() {
20+
return this.estado;
21+
}
22+
23+
@java.lang.SuppressWarnings("all")
24+
public void setEstado(final Juego estado) {
25+
this.estado = estado;
26+
}
27+
28+
@java.lang.Override
29+
@java.lang.SuppressWarnings("all")
30+
public boolean equals(final java.lang.Object o) {
31+
if (o == this) return true;
32+
if (!(o instanceof Originator)) return false;
33+
final Originator other = (Originator) o;
34+
if (!other.canEqual((java.lang.Object) this)) return false;
35+
final java.lang.Object this$estado = this.getEstado();
36+
final java.lang.Object other$estado = other.getEstado();
37+
if (this$estado == null ? other$estado != null : !this$estado.equals(other$estado)) return false;
38+
return true;
39+
}
40+
41+
@java.lang.SuppressWarnings("all")
42+
protected boolean canEqual(final java.lang.Object other) {
43+
return other instanceof Originator;
44+
}
45+
46+
@java.lang.Override
47+
@java.lang.SuppressWarnings("all")
48+
public int hashCode() {
49+
final int PRIME = 59;
50+
int result = 1;
51+
final java.lang.Object $estado = this.getEstado();
52+
result = result * PRIME + ($estado == null ? 43 : $estado.hashCode());
53+
return result;
54+
}
55+
56+
@java.lang.Override
57+
@java.lang.SuppressWarnings("all")
58+
public java.lang.String toString() {
59+
return "Originator(estado=" + this.getEstado() + ")";
60+
}
1861
}
Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,32 @@
11
package designpatterns.behavioral.strategy;
22

3-
import lombok.NonNull;
43
import org.apache.commons.lang3.ClassUtils;
54
import org.apache.commons.lang3.StringUtils;
65
import org.apache.commons.lang3.reflect.MethodUtils;
76
import org.apache.commons.text.WordUtils;
87

9-
108
public class AppDesignPatternStrategy1 {
11-
129
public static void main(String[] args) throws Exception {
13-
1410
ContextVendedorNivel contextVendedorNivel = new ContextVendedorNivel(new VendedorNivel1());
1511
System.out.println(contextVendedorNivel.profitFromSale(50));
16-
1712
String tipoDeVendedorFromDatabase = "VENDEDOR_NIVEL_1";
1813
String tipoDeVendedorParsed = parseTipoDeVendedorLikeNameClass(tipoDeVendedorFromDatabase);
1914
final Class<?> clazz = ClassUtils.getClass("designpatterns.behavioral.strategy." + tipoDeVendedorParsed);
2015
// Object profitFromSale = MethodUtils.invokeStaticMethod(clazz, "profitFromSale", 50);
21-
2216
Object vendedorNivelTest = clazz.getDeclaredConstructor().newInstance();
2317
Object profitFromSaleInvoke = MethodUtils.invokeMethod(vendedorNivelTest, "profitFromSale", 50);
2418
System.out.println(profitFromSaleInvoke);
25-
2619
//like ...this way
2720
ContextVendedorNivel contextVendedorNivelTest2 = new ContextVendedorNivel((StrategyVendedor) vendedorNivelTest);
2821
System.out.println(contextVendedorNivelTest2.profitFromSale(50));
29-
3022
}
3123

32-
private static String parseTipoDeVendedorLikeNameClass(@NonNull String tipoVendedor) {
24+
private static String parseTipoDeVendedorLikeNameClass(String tipoVendedor) {
25+
if (tipoVendedor == null) {
26+
throw new java.lang.NullPointerException("tipoVendedor is marked non-null but is null");
27+
}
3328
return StringUtils.replaceEach( //
34-
WordUtils.capitalizeFully(tipoVendedor, new char[]{'_'}), //
35-
new String[]{"_"}, new String[]{StringUtils.EMPTY});
29+
WordUtils.capitalizeFully(tipoVendedor, new char[] {'_'}), //
30+
new String[] {"_"}, new String[] {StringUtils.EMPTY});
3631
}
37-
3832
}
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
package designpatterns.behavioral.strategy;
22

3-
import lombok.AllArgsConstructor;
4-
53
import java.math.BigDecimal;
64

7-
@AllArgsConstructor
85
public class ContextVendedorNivel {
9-
106
private StrategyVendedor strategyVendedor;
117

12-
public BigDecimal profitFromSale(int cantidadDeProductoVendido){
8+
public BigDecimal profitFromSale(int cantidadDeProductoVendido) {
139
return strategyVendedor.profitFromSale(cantidadDeProductoVendido);
1410
}
1511

12+
@java.lang.SuppressWarnings("all")
13+
public ContextVendedorNivel(final StrategyVendedor strategyVendedor) {
14+
this.strategyVendedor = strategyVendedor;
15+
}
1616
}

0 commit comments

Comments
 (0)