From 5f4dbd695863f41a4799c28cf30cc30725fd1dc3 Mon Sep 17 00:00:00 2001 From: eulu Date: Mon, 9 Dec 2024 15:20:40 +0200 Subject: [PATCH] Fix code style --- src/main/java/core/basesyntax/HelloWorld.java | 46 +++++++++++++++++++ .../java/core/basesyntax/Hello_World.java | 46 ------------------- src/main/java/core/basesyntax/Model/Cat.java | 16 ------- src/main/java/core/basesyntax/Model/Dog.java | 4 -- src/main/java/core/basesyntax/model/Cat.java | 16 +++++++ src/main/java/core/basesyntax/model/Dog.java | 4 ++ 6 files changed, 66 insertions(+), 66 deletions(-) create mode 100644 src/main/java/core/basesyntax/HelloWorld.java delete mode 100644 src/main/java/core/basesyntax/Hello_World.java delete mode 100644 src/main/java/core/basesyntax/Model/Cat.java delete mode 100644 src/main/java/core/basesyntax/Model/Dog.java create mode 100644 src/main/java/core/basesyntax/model/Cat.java create mode 100644 src/main/java/core/basesyntax/model/Dog.java diff --git a/src/main/java/core/basesyntax/HelloWorld.java b/src/main/java/core/basesyntax/HelloWorld.java new file mode 100644 index 00000000..5fcd05bb --- /dev/null +++ b/src/main/java/core/basesyntax/HelloWorld.java @@ -0,0 +1,46 @@ +package core.basesyntax; + +import core.basesyntax.model.Cat; +import core.basesyntax.model.Dog; +import java.time.LocalDate; + +public class HelloWorld { + private String helloStr; + private int variable; + private int age; + private int size; + + public static void main(String[] args) { + Dog dog = new Dog(); + Cat cat = new Cat(); + } + + private String getFromOneToTen() { + String result = ""; + + for (int i = 0; i < 10; i++) { + if (i % 2 == 0) { + result = result + i + " "; + } + } + return result; + } + + private void sayHello(String hello) { + System.out.println("Hello, Mate! I am happy to see you! This class looks weird!" + + " Your task is to fix the checkstyle in this file." + + " Your goal is to run `mvn clean package` and receive `BUILD SUCCESS` message"); + System.out.println(hello); + } + + private void initializeVariables() { + helloStr = "Hello mates!"; + System.out.println(helloStr); + variable = LocalDate.now().getYear(); + System.out.println("It is " + variable + "year"); + age = 25; + System.out.println("I'm " + age); + size = 42; + System.out.println("The size is " + size); + } +} diff --git a/src/main/java/core/basesyntax/Hello_World.java b/src/main/java/core/basesyntax/Hello_World.java deleted file mode 100644 index dbfc306e..00000000 --- a/src/main/java/core/basesyntax/Hello_World.java +++ /dev/null @@ -1,46 +0,0 @@ -package core.basesyntax; - -import core.basesyntax.Model.Dog; -import core.basesyntax.Model.Cat; - -import java.time.LocalDate; -import java.util.Objects; - -public class Hello_World -{ - private String a; - private int vARIaBLE; - private int age, size; - - - public static void main(String[] args) { - Dog dog = new Dog(); - Cat cat = new Cat(); } - - private String getFromOneToTen() { - String result=""; - - for (int i=0; i<10; i++){ - if(i%2==0) - result = result + i + " "; - } - return result; - } - - private void sayHello(String HELLO) { - System.out.println("Hello, Mate! I am happy to see you! This class looks weird! Your task is to fix the checkstyle in this file." + - " Your goal is to run `mvn clean package` and receive `BUILD SUCCESS` message"); - System.out.println(HELLO); - } - - private void initializeVariables() { - a = "Hello mates!"; - System.out.println(a); - vARIaBLE = LocalDate.now().getYear(); - System.out.println("It is " + vARIaBLE + "year"); - age = 25; - System.out.println("I'm " + age); - size = 42; - System.out.println("The size is " + size); - } -} diff --git a/src/main/java/core/basesyntax/Model/Cat.java b/src/main/java/core/basesyntax/Model/Cat.java deleted file mode 100644 index 90efa6d8..00000000 --- a/src/main/java/core/basesyntax/Model/Cat.java +++ /dev/null @@ -1,16 +0,0 @@ -package core.basesyntax.Model; - -public class Cat { - private int age; - private String name; - private String ownerName; - - @Override - public String toString() { - return "Cat{" + - "age=" + age + - ", name='" + name + '\'' + - ", ownerName='" + ownerName + '\'' + - '}'; - } -} diff --git a/src/main/java/core/basesyntax/Model/Dog.java b/src/main/java/core/basesyntax/Model/Dog.java deleted file mode 100644 index 690360a6..00000000 --- a/src/main/java/core/basesyntax/Model/Dog.java +++ /dev/null @@ -1,4 +0,0 @@ -package core.basesyntax.Model; - -public class Dog { -} diff --git a/src/main/java/core/basesyntax/model/Cat.java b/src/main/java/core/basesyntax/model/Cat.java new file mode 100644 index 00000000..f706bb1e --- /dev/null +++ b/src/main/java/core/basesyntax/model/Cat.java @@ -0,0 +1,16 @@ +package core.basesyntax.model; + +public class Cat { + private int age; + private String name; + private String ownerName; + + @Override + public String toString() { + return "Cat{" + + "age=" + age + + ", name='" + name + '\'' + + ", ownerName='" + ownerName + '\'' + + '}'; + } +} diff --git a/src/main/java/core/basesyntax/model/Dog.java b/src/main/java/core/basesyntax/model/Dog.java new file mode 100644 index 00000000..b4d904ce --- /dev/null +++ b/src/main/java/core/basesyntax/model/Dog.java @@ -0,0 +1,4 @@ +package core.basesyntax.model; + +public class Dog { +}