Skip to content

Commit 8b3c1d1

Browse files
committed
调整代码结构
1 parent d654030 commit 8b3c1d1

100 files changed

Lines changed: 604 additions & 283 deletions

File tree

Some content is hidden

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

codes/javalib/javalib-bean/src/main/java/io/github/dunwu/javalib/bean/Company.java

Lines changed: 0 additions & 22 deletions
This file was deleted.

codes/javalib/javalib-bean/src/main/java/io/github/dunwu/javalib/bean/Person.java

Lines changed: 0 additions & 24 deletions
This file was deleted.

codes/javalib/javalib-bean/src/test/java/io/github/dunwu/javalib/bean/LombokTest.java

Lines changed: 0 additions & 94 deletions
This file was deleted.

codes/javalib/javalib-test/src/main/resources/logback.xml

Lines changed: 0 additions & 14 deletions
This file was deleted.

codes/javatool/pom.xml

Lines changed: 0 additions & 17 deletions
This file was deleted.

codes/pom.xml

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,54 @@
77
<groupId>io.github.dunwu</groupId>
88
<artifactId>javalib-bean</artifactId>
99
<version>1.0.0</version>
10-
<description>javalib 之JavaBean库示例集锦</description>
10+
<packaging>jar</packaging>
11+
12+
<name>java-bean</name>
13+
<description>JavaBean 相关的 Lib 示例</description>
1114

1215
<properties>
1316
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1417
<java.version>1.8</java.version>
1518
<maven.compiler.source>${java.version}</maven.compiler.source>
1619
<maven.compiler.target>${java.version}</maven.compiler.target>
20+
<dunwu.version>0.4.8</dunwu.version>
1721
</properties>
1822

1923
<dependencies>
2024
<dependency>
2125
<groupId>org.projectlombok</groupId>
2226
<artifactId>lombok</artifactId>
23-
<version>1.16.8</version>
2427
</dependency>
28+
29+
<!--test-->
2530
<dependency>
2631
<groupId>junit</groupId>
2732
<artifactId>junit</artifactId>
28-
<version>4.12</version>
33+
<scope>test</scope>
34+
</dependency>
35+
<dependency>
36+
<groupId>org.assertj</groupId>
37+
<artifactId>assertj-core</artifactId>
2938
<scope>test</scope>
3039
</dependency>
3140
</dependencies>
41+
<dependencyManagement>
42+
<dependencies>
43+
<dependency>
44+
<groupId>io.github.dunwu</groupId>
45+
<artifactId>dunwu-dependencies</artifactId>
46+
<version>${dunwu.version}</version>
47+
<type>pom</type>
48+
<scope>import</scope>
49+
</dependency>
50+
</dependencies>
51+
</dependencyManagement>
3252

3353
<build>
3454
<resources>
3555
<resource>
36-
<filtering>true</filtering>
3756
<directory>src/main/resources</directory>
3857
</resource>
3958
</resources>
4059
</build>
41-
4260
</project>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package io.github.dunwu.javalib.lombok;
2+
3+
import lombok.Data;
4+
5+
import java.util.List;
6+
7+
/**
8+
* <code>@Data</code> 示例
9+
*
10+
* @author <a href="mailto:forbreak@163.com">Zhang Peng</a>
11+
* @see <a href="http://jnb.ociweb.com/jnb/jnbJan2010.html#data">@Data</a>
12+
* @since 2019-11-22
13+
*/
14+
@Data(staticConstructor = "of")
15+
public class DataDemo {
16+
17+
private final Person founder;
18+
19+
protected List<Person> employees;
20+
21+
private String name;
22+
23+
}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
package io.github.dunwu.javalib.lombok;
2+
3+
import lombok.Data;
4+
import lombok.EqualsAndHashCode;
5+
import lombok.NonNull;
6+
7+
class Parent {}
8+
9+
/**
10+
* <code>@EqualsAndHashCode</code> 示例
11+
*
12+
* @author <a href="mailto:forbreak@163.com">Zhang Peng</a>
13+
* @see <a href="http://jnb.ociweb.com/jnb/jnbJan2010.html#equals">@EqualsAndHashCode</a>
14+
* @since 2019-11-22
15+
*/
16+
@Data
17+
@EqualsAndHashCode(callSuper = true, exclude = { "address", "city", "state", "zip" })
18+
public class EqualsAndHashCodeDemo extends Person {
19+
20+
@NonNull
21+
private String name;
22+
23+
@NonNull
24+
private Gender gender;
25+
26+
private String ssn;
27+
28+
private String address;
29+
30+
private String city;
31+
32+
private String state;
33+
34+
private String zip;
35+
36+
public EqualsAndHashCodeDemo(@NonNull String name, @NonNull Gender gender) {
37+
this.name = name;
38+
this.gender = gender;
39+
}
40+
41+
public EqualsAndHashCodeDemo(@NonNull String name, @NonNull Gender gender,
42+
String ssn, String address, String city, String state, String zip) {
43+
this.name = name;
44+
this.gender = gender;
45+
this.ssn = ssn;
46+
this.address = address;
47+
this.city = city;
48+
this.state = state;
49+
this.zip = zip;
50+
}
51+
52+
enum Gender {
53+
Male,
54+
Female
55+
}
56+
57+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package io.github.dunwu.javalib.lombok;
2+
3+
import lombok.AccessLevel;
4+
import lombok.Getter;
5+
import lombok.Setter;
6+
7+
/**
8+
* <code>@Getter</code> 和 <code>@Setter</code> 示例
9+
*
10+
* @author <a href="mailto:forbreak@163.com">Zhang Peng</a>
11+
* @see <a href="http://jnb.ociweb.com/jnb/jnbJan2010.html#gettersetter">@Getter and @Setter</a>
12+
* @since 2019-11-22
13+
*/
14+
public class GetterAndSetterDemo {
15+
16+
@Getter
17+
@Setter
18+
private boolean employed = true;
19+
20+
@Setter(AccessLevel.PROTECTED)
21+
private String name;
22+
23+
}

0 commit comments

Comments
 (0)