Skip to content

Commit 331f280

Browse files
javaqueryVicky Thakor
authored andcommitted
fix: code format
1 parent 9e0c6c5 commit 331f280

File tree

7 files changed

+563
-563
lines changed

7 files changed

+563
-563
lines changed

build.gradle

Lines changed: 61 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,88 @@
11
plugins {
2-
id 'java'
3-
id 'maven-publish'
4-
id 'signing'
2+
id 'java'
3+
id 'maven-publish'
4+
id 'signing'
55
}
66

77
group 'com.javaquery'
88
version '1.0'
99

1010
repositories {
11-
mavenCentral()
11+
mavenCentral()
1212
}
1313

1414
dependencies {
15-
testCompile ('org.junit.jupiter:junit-jupiter:5.7.0')
15+
testCompile('org.junit.jupiter:junit-jupiter:5.7.0')
1616
}
1717

1818
test {
19-
useJUnitPlatform()
19+
useJUnitPlatform()
2020
}
2121

2222
java {
23-
withJavadocJar()
24-
withSourcesJar()
23+
withJavadocJar()
24+
withSourcesJar()
2525
}
2626

2727
publishing {
28-
publications {
29-
mavenJava(MavenPublication) {
30-
artifactId = 'util'
31-
from components.java
28+
publications {
29+
mavenJava(MavenPublication) {
30+
artifactId = 'util'
31+
from components.java
3232

33-
versionMapping {
34-
usage('java-api') {
35-
fromResolutionOf('runtimeClasspath')
36-
}
37-
usage('java-runtime') {
38-
fromResolutionResult()
39-
}
40-
}
41-
pom {
42-
name = 'Java Util Library'
43-
description = 'Java util class to reduce boilerplate codes'
44-
url = 'https://github.com/javaquery/util'
45-
licenses {
46-
license {
47-
name = 'MIT'
48-
url = 'https://github.com/javaquery/util/blob/main/LICENSE'
49-
}
50-
}
51-
developers {
52-
developer {
53-
id = 'javaquery'
54-
name = 'Vicky Thakor'
55-
56-
timezone = '+05:30'
57-
}
58-
}
59-
scm {
60-
connection = 'scm:git:git://github.com/javaquery/util.git'
61-
developerConnection = 'scm:git:ssh://github.com/javaquery/util.git'
62-
url = 'https://github.com/javaquery/util'
63-
}
64-
}
65-
}
66-
}
67-
repositories {
68-
maven {
69-
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
70-
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots"
71-
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
72-
credentials {
73-
username "javaquery"
74-
password "*****"
75-
}
76-
}
77-
}
33+
versionMapping {
34+
usage('java-api') {
35+
fromResolutionOf('runtimeClasspath')
36+
}
37+
usage('java-runtime') {
38+
fromResolutionResult()
39+
}
40+
}
41+
pom {
42+
name = 'Java Util Library'
43+
description = 'Java util class to reduce boilerplate codes'
44+
url = 'https://github.com/javaquery/util'
45+
licenses {
46+
license {
47+
name = 'MIT'
48+
url = 'https://github.com/javaquery/util/blob/main/LICENSE'
49+
}
50+
}
51+
developers {
52+
developer {
53+
id = 'javaquery'
54+
name = 'Vicky Thakor'
55+
56+
timezone = '+05:30'
57+
}
58+
}
59+
scm {
60+
connection = 'scm:git:git://github.com/javaquery/util.git'
61+
developerConnection = 'scm:git:ssh://github.com/javaquery/util.git'
62+
url = 'https://github.com/javaquery/util'
63+
}
64+
}
65+
}
66+
}
67+
repositories {
68+
maven {
69+
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
70+
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots"
71+
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
72+
credentials {
73+
username "javaquery"
74+
password "a2a@\$ASDF#777"
75+
}
76+
}
77+
}
7878
}
7979

8080
signing {
81-
sign publishing.publications.mavenJava
81+
sign publishing.publications.mavenJava
8282
}
8383

8484
javadoc {
85-
if(JavaVersion.current().isJava9Compatible()) {
86-
options.addBooleanOption('html5', true)
87-
}
85+
if (JavaVersion.current().isJava9Compatible()) {
86+
options.addBooleanOption('html5', true)
87+
}
8888
}

src/main/java/com/javaquery/util/Objects.java

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,27 @@
66
*/
77
public class Objects {
88

9-
/**
10-
* Returns {@code true} if the provided reference is {@code null} otherwise
11-
* returns {@code false}.
12-
*
13-
* @param obj a reference to be checked against {@code null}
14-
* @return {@code true} if the provided reference is {@code null} otherwise
15-
* {@code false}
16-
*/
17-
public static boolean isNull(Object obj){
18-
return obj == null;
19-
}
9+
/**
10+
* Returns {@code true} if the provided reference is {@code null} otherwise
11+
* returns {@code false}.
12+
*
13+
* @param obj a reference to be checked against {@code null}
14+
* @return {@code true} if the provided reference is {@code null} otherwise
15+
* {@code false}
16+
*/
17+
public static boolean isNull(Object obj) {
18+
return obj == null;
19+
}
2020

21-
/**
22-
* Returns {@code true} if the provided reference is non-{@code null}
23-
* otherwise returns {@code false}.
24-
*
25-
* @param obj a reference to be checked against {@code null}
26-
* @return {@code true} if the provided reference is non-{@code null}
27-
* otherwise {@code false}
28-
*/
29-
public static boolean nonNull(Object obj){
30-
return obj != null;
31-
}
21+
/**
22+
* Returns {@code true} if the provided reference is non-{@code null}
23+
* otherwise returns {@code false}.
24+
*
25+
* @param obj a reference to be checked against {@code null}
26+
* @return {@code true} if the provided reference is non-{@code null}
27+
* otherwise {@code false}
28+
*/
29+
public static boolean nonNull(Object obj) {
30+
return obj != null;
31+
}
3232
}

src/main/java/com/javaquery/util/Regex.java

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -8,46 +8,46 @@
88
*/
99
public class Regex {
1010

11-
public static final String REGEX_NUMBER = "^-?[0-9]\\d*(\\.\\d+)?$";
12-
public static final String REGEX_ALPHA_NUMERIC = "^[a-zA-Z0-9]*$";
13-
public static final String REGEX_EMAIL =
14-
"^[a-zA-Z0-9.!#$%&'*+\\/=?^_`{|}~-]+@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))[^_@!*]*?$";
11+
public static final String REGEX_NUMBER = "^-?[0-9]\\d*(\\.\\d+)?$";
12+
public static final String REGEX_ALPHA_NUMERIC = "^[a-zA-Z0-9]*$";
13+
public static final String REGEX_EMAIL =
14+
"^[a-zA-Z0-9.!#$%&'*+\\/=?^_`{|}~-]+@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))[^_@!*]*?$";
1515

16-
public static final Pattern EMAIL_PATTERN = Pattern.compile(REGEX_EMAIL);
16+
public static final Pattern EMAIL_PATTERN = Pattern.compile(REGEX_EMAIL);
1717

18-
/**
19-
* Returns {@code true} if the provided String is valid number otherwise
20-
* returns {@code false}.
21-
*
22-
* @param value a String to be checked against number regular expression
23-
* @return Returns {@code true} if the provided String is valid number otherwise
24-
* returns {@code false}.
25-
*/
26-
public static boolean isNumber(String value){
27-
return Objects.nonNull(value) && value.matches(Regex.REGEX_NUMBER);
28-
}
18+
/**
19+
* Returns {@code true} if the provided String is valid number otherwise
20+
* returns {@code false}.
21+
*
22+
* @param value a String to be checked against number regular expression
23+
* @return Returns {@code true} if the provided String is valid number otherwise
24+
* returns {@code false}.
25+
*/
26+
public static boolean isNumber(String value) {
27+
return Objects.nonNull(value) && value.matches(Regex.REGEX_NUMBER);
28+
}
2929

30-
/**
31-
* Returns {@code true} if the provided String is valid alpha numeric otherwise
32-
* returns {@code false}.
33-
*
34-
* @param value a String to be checked against alpha numeric regular expression
35-
* @return Returns {@code true} if the provided String is valid alpha numeric otherwise
36-
* returns {@code false}.
37-
*/
38-
public static boolean isAlphaNumeric(String value) {
39-
return Objects.nonNull(value) && value.matches(Regex.REGEX_ALPHA_NUMERIC);
40-
}
30+
/**
31+
* Returns {@code true} if the provided String is valid alpha numeric otherwise
32+
* returns {@code false}.
33+
*
34+
* @param value a String to be checked against alpha numeric regular expression
35+
* @return Returns {@code true} if the provided String is valid alpha numeric otherwise
36+
* returns {@code false}.
37+
*/
38+
public static boolean isAlphaNumeric(String value) {
39+
return Objects.nonNull(value) && value.matches(Regex.REGEX_ALPHA_NUMERIC);
40+
}
4141

42-
/**
43-
* Returns {@code true} if the provided String is valid email otherwise
44-
* returns {@code false}.
45-
*
46-
* @param value a String to be checked against email regular expression
47-
* @return Returns {@code true} if the provided String is valid email otherwise
48-
* returns {@code false}.
49-
*/
50-
public static boolean isValidEmail(String value) {
51-
return Objects.nonNull(value) && Regex.EMAIL_PATTERN.matcher(value).matches();
52-
}
42+
/**
43+
* Returns {@code true} if the provided String is valid email otherwise
44+
* returns {@code false}.
45+
*
46+
* @param value a String to be checked against email regular expression
47+
* @return Returns {@code true} if the provided String is valid email otherwise
48+
* returns {@code false}.
49+
*/
50+
public static boolean isValidEmail(String value) {
51+
return Objects.nonNull(value) && Regex.EMAIL_PATTERN.matcher(value).matches();
52+
}
5353
}

0 commit comments

Comments
 (0)