Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/maven/version.jupiter-5.11.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Pastor authored Oct 8, 2024
2 parents c2f136e + 94a11b0 commit 1b1f5db
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 1 deletion.
File renamed without changes.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<version.junit>1.11.1</version.junit>
<version.junit>1.11.2</version.junit>
<version.jupiter>5.11.2</version.jupiter>
<version.pmd>6.52.0</version.pmd>
</properties>
Expand Down
77 changes: 77 additions & 0 deletions vol0/src/main/java/ru/mifi/practice/vol0/klass/Fly.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
package ru.mifi.practice.vol0.klass;

import java.util.Arrays;

public class Fly {
Wing leftWing;
Wing rightWing;
Eye leftEye;
Eye rightEye;
Leg[] legs;
Trunk trunk;

public Fly() {
}

public Fly(Wing leftWing, Wing rightWing,
Eye leftEye, Eye rightEye,
Leg[] legs, Trunk trunk) {
this.leftWing = leftWing;
this.rightWing = rightWing;
this.leftEye = leftEye;
this.rightEye = rightEye;
this.legs = legs;
this.trunk = trunk;
}

public static void main(String[] args) {
Fly fly = new Fly();
fly.leftWing = new Wing();
fly.rightWing = new Wing();
fly.leftEye = new Eye();
fly.rightEye = new Eye();
fly.legs = new Leg[]{
new Leg(),
new Leg(),
new Leg(),
new Leg(),
new Leg(),
new Leg()
};
fly.trunk = new Trunk();
System.out.println(fly);
System.out.println(fly.validate());
}

boolean validate() {
return leftWing != null && rightWing != null
&& leftEye != null && rightEye != null
&& legs != null && legs.length == 6
&& trunk != null;
}

@Override
public String toString() {
return "Fly{" +
"leftWing=" + leftWing +
", rightWing=" + rightWing +
", leftEye=" + leftEye +
", rightEye=" + rightEye +
", legs=" + Arrays.toString(legs) +
", trunk=" + trunk +
'}';
}

public static class Wing {
}

public static class Eye {
}

public static class Leg {
}

public static class Trunk {

}
}

0 comments on commit 1b1f5db

Please sign in to comment.