This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.github.mattnicee7.myplugin.adapter; | |
public interface Adapter<T, V> { | |
T adapt(V data); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Application { | |
public static void main(String[] args) { | |
ShapeFactory shapeFactory = new ShapeFactory(); | |
Shape shape1 = shapeFactory.getShape("CIRCLE"); | |
shape1.draw(); | |
// Output: Wow! you drawed a circle. | |
Shape shape2 = shapeFactory.getShape("RECTANGLE"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.github.mattnicee7; | |
import com.j256.simplecsv.common.CsvColumn; | |
import lombok.*; | |
@NoArgsConstructor | |
@AllArgsConstructor | |
@Getter | |
@Setter | |
@ToString |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Application { | |
public static void main(String[] args) { | |
try (Scanner input = new Scanner(System.in)) { | |
System.out.print("Digite os 9 primeiros numeros do seu cpf: "); | |
List<Integer> cpf = Arrays.stream(input.next().split("")) | |
.map(Integer::parseInt) | |
.collect(Collectors.toList()); | |
cpf.add(getVerificationCode(10, cpf)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.InputStream; | |
import java.math.BigDecimal; | |
import java.math.BigInteger; | |
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.Objects; | |
import java.util.Scanner; | |
import java.util.function.Supplier; | |
/** |