File tree 10 files changed +101
-66
lines changed
src/main/java/docs/oracle/com/javase/tutorial/java/concepts/interface_/WhatIsAnInterface
src/test/java/docs/oracle/com/javase/tutorial/java/concepts/inheritance/WhatIsInheritance
10 files changed +101
-66
lines changed Original file line number Diff line number Diff line change 6
6
<attribute name =" maven.pomderived" value =" true" />
7
7
</attributes >
8
8
</classpathentry >
9
- <classpathentry kind =" src" output =" target/test-classes" path =" src/test/java" >
10
- <attributes >
11
- <attribute name =" optional" value =" true" />
12
- <attribute name =" maven.pomderived" value =" true" />
13
- <attribute name =" test" value =" true" />
14
- </attributes >
15
- </classpathentry >
16
9
<classpathentry kind =" con" path =" org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7" >
17
10
<attributes >
18
11
<attribute name =" maven.pomderived" value =" true" />
Original file line number Diff line number Diff line change 1
1
eclipse.preferences.version =1
2
2
encoding//src/main/java =UTF-8
3
- encoding//src/test/java =UTF-8
4
3
encoding/<project>=UTF-8
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ <factorypath>
2
+ <factorypathentry kind="VARJAR" id="M2_REPO/org/projectlombok/lombok/1.18.8/lombok-1.18.8.jar" enabled="true" runInBatchMode="false"/>
3
+ </factorypath>
Original file line number Diff line number Diff line change
1
+ <project xmlns =" http://maven.apache.org/POM/4.0.0" xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
2
+ xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" >
3
+ <modelVersion >4.0.0</modelVersion >
4
+
5
+ <groupId >docs.oracle.com.javase.tutorial.java.concepts.interface_</groupId >
6
+ <artifactId >WhatIsAnInterface</artifactId >
7
+ <version >0.0.1</version >
8
+ <packaging >jar</packaging >
9
+
10
+ <name >WhatIsAnInterface</name >
11
+ <url >http://maven.apache.org</url >
12
+
13
+ <properties >
14
+ <project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
15
+ </properties >
16
+
17
+ <dependencies >
18
+ <dependency >
19
+ <groupId >junit</groupId >
20
+ <artifactId >junit</artifactId >
21
+ <version >3.8.1</version >
22
+ <scope >test</scope >
23
+ </dependency >
24
+ <dependency >
25
+ <groupId >org.projectlombok</groupId >
26
+ <artifactId >lombok</artifactId >
27
+ <version >1.18.8</version >
28
+ <scope >provided</scope >
29
+ </dependency >
30
+ </dependencies >
31
+ </project >
Original file line number Diff line number Diff line change
1
+ package docs .oracle .com .javase .tutorial .java .concepts .interface_ .WhatIsAnInterface ;
2
+
3
+ import lombok .AllArgsConstructor ;
4
+ import lombok .Data ;
5
+ import lombok .Setter ;
6
+ import lombok .ToString ;
7
+
8
+ @ Setter
9
+ @ ToString
10
+ @ AllArgsConstructor
11
+ public @ Data class ACMEBicycle implements Bicycle {
12
+
13
+ int cadence = 0 ;
14
+ int speed = 0 ;
15
+ int gear = 1 ;
16
+
17
+ public void changeCadence (int newCadence ){
18
+ cadence = newCadence ;
19
+ }
20
+
21
+ public void speedUp (int increment ) {
22
+ speed += increment ;
23
+ }
24
+
25
+ public void applyBrakes (int decrement ) {
26
+ speed -= decrement ;
27
+ }
28
+
29
+ public void changeGear (int newGear ){
30
+ gear = newGear ;
31
+ }
32
+
33
+ public void printStates (){
34
+ System .out .println (toString ());
35
+ }
36
+
37
+ }
Original file line number Diff line number Diff line change
1
+ package docs .oracle .com .javase .tutorial .java .concepts .interface_ .WhatIsAnInterface ;
2
+
3
+ /**
4
+ * Hello world!
5
+ *
6
+ */
7
+ public class App
8
+ {
9
+ public static void main ( String [] args )
10
+ {
11
+ Bicycle b = new ACMEBicycle (1 ,2 ,3 );
12
+ b .printStates ();
13
+ }
14
+ }
Original file line number Diff line number Diff line change
1
+ package docs .oracle .com .javase .tutorial .java .concepts .interface_ .WhatIsAnInterface ;
2
+
3
+ interface Bicycle {
4
+ void changeCadence (int newValue );
5
+
6
+ void changeGear (int newValue );
7
+
8
+ void speedUp (int increment );
9
+
10
+ void applyBrakes (int decrement );
11
+
12
+ void printStates ();
13
+ }
Original file line number Diff line number Diff line change
1
+ <factorypath>
2
+ <factorypathentry kind="VARJAR" id="M2_REPO/org/projectlombok/lombok/1.18.8/lombok-1.18.8.jar" enabled="true" runInBatchMode="false"/>
3
+ </factorypath>
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments