Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
q3769 committed Mar 16, 2023
1 parent b1d0cb2 commit fc64556
Show file tree
Hide file tree
Showing 14 changed files with 37 additions and 37 deletions.
36 changes: 18 additions & 18 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@ name: OSSRH Maven Central Deploy

on:
release:
types: [created]
types: [ created ]

jobs:
publish:
runs-on: ubuntu-latest
environment: ossrh
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Publish to OSSRH for Maven Central
run: mvn --batch-mode deploy -Prelease
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Publish to OSSRH for Maven Central
run: mvn --batch-mode deploy -Prelease
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

<groupId>io.github.elf4j</groupId>
<artifactId>elf4j-impl-core</artifactId>
<version>0.5.3</version>
<version>0.5.4</version>
<packaging>jar</packaging>
<name>elf4j-impl-core</name>
<description>Native logging service provider implementation of ELF4J (Easy Logging Facade For Java)
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/elf4j/impl/core/writer/GroupWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ private GroupWriter(Set<LogWriter> writers) {
* @return the composite writer containing all writers configured in the specified properties
*/
public static GroupWriter from(Properties properties) {
return new GroupWriter(LogWriterType.parseAllLogWriters(properties));
return new GroupWriter(WriterType.parseAllLogWriters(properties));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@
/**
*
*/
public enum LogWriterType {
public enum WriterType {
/**
*
*/
StandardStreams {
STANDARD_STREAMS {
@Override
Set<LogWriter> parseLogWriters(Properties properties) {
return PropertiesUtils.getPropertiesGroupOfType("stream", properties)
Expand All @@ -55,7 +55,7 @@ Set<LogWriter> parseLogWriters(Properties properties) {
* @return all writers parsed from the specified properties
*/
public static Set<LogWriter> parseAllLogWriters(Properties properties) {
return EnumSet.allOf(LogWriterType.class)
return EnumSet.allOf(WriterType.class)
.stream()
.flatMap(type -> type.parseLogWriters(properties).stream())
.collect(Collectors.toSet());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class ClassPattern implements LogPattern {
*/
@Nonnull
public static ClassPattern from(@NonNull String pattern) {
if (!LogPatternType.CLASS.isTargetTypeOf(pattern)) {
if (!PatternType.CLASS.isTargetTypeOf(pattern)) {
throw new IllegalArgumentException("pattern: " + pattern);
}
return new ClassPattern(LogPattern.getPatternOption(pattern)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class GroupPattern implements LogPattern {
*/
@Nonnull
public static GroupPattern from(@NonNull String pattern) {
return new GroupPattern(LogPatternType.parseAllPatternsOrThrow(pattern));
return new GroupPattern(PatternType.parseAllPatternsOrThrow(pattern));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public class JsonPattern implements LogPattern {
* @return converted pattern object
*/
public static JsonPattern from(@NonNull String pattern) {
if (!LogPatternType.JSON.isTargetTypeOf(pattern)) {
if (!PatternType.JSON.isTargetTypeOf(pattern)) {
throw new IllegalArgumentException("pattern: " + pattern);
}
Optional<String> patternOption = LogPattern.getPatternOption(pattern);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ private LevelPattern(int displayLength) {
*/
@Nonnull
public static LevelPattern from(@NonNull String pattern) {
if (!LogPatternType.LEVEL.isTargetTypeOf(pattern)) {
if (!PatternType.LEVEL.isTargetTypeOf(pattern)) {
throw new IllegalArgumentException("pattern: " + pattern);
}
return new LevelPattern(LogPattern.getPatternOption(pattern)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class MessageAndExceptionPattern implements LogPattern {
*/
@Nonnull
public static MessageAndExceptionPattern from(String pattern) {
if (!LogPatternType.MESSAGE.isTargetTypeOf(pattern)) {
if (!PatternType.MESSAGE.isTargetTypeOf(pattern)) {
throw new IllegalArgumentException("pattern text: " + pattern);
}
return new MessageAndExceptionPattern();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class MethodPattern implements LogPattern {
*/
@Nonnull
public static MethodPattern from(String pattern) {
if (!LogPatternType.METHOD.isTargetTypeOf(pattern)) {
if (!PatternType.METHOD.isTargetTypeOf(pattern)) {
throw new IllegalArgumentException("pattern: " + pattern);
}
return new MethodPattern();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
/**
*
*/
public enum LogPatternType {
public enum PatternType {
/**
*
*/
Expand Down Expand Up @@ -174,20 +174,20 @@ public static List<LogPattern> parseAllPatternsOrThrow(String pattern) {
iPattern = pattern.substring(i, iEnd);
i = iEnd;
}
logPatterns.add(LogPatternType.parsePatternOrThrow(iPattern));
logPatterns.add(PatternType.parsePatternOrThrow(iPattern));
}
return logPatterns;
}

private static boolean isPatternOfType(LogPatternType targetPatternType, String pattern) {
private static boolean isPatternOfType(PatternType targetPatternType, String pattern) {
if (targetPatternType == VERBATIM) {
return EnumSet.complementOf(EnumSet.of(VERBATIM)).stream().noneMatch(type -> type.isTargetTypeOf(pattern));
}
return targetPatternType.name().equalsIgnoreCase(pattern.split(":", 2)[0].trim());
}

private static LogPattern parsePatternOrThrow(String pattern) {
return EnumSet.allOf(LogPatternType.class)
return EnumSet.allOf(PatternType.class)
.stream()
.map(type -> type.parsePattern(pattern))
.filter(Objects::nonNull)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class ThreadPattern implements LogPattern {
*/
@Nonnull
public static ThreadPattern from(@NonNull String pattern) {
if (!LogPatternType.THREAD.isTargetTypeOf(pattern)) {
if (!PatternType.THREAD.isTargetTypeOf(pattern)) {
throw new IllegalArgumentException("pattern: " + pattern);
}
return new ThreadPattern(LogPattern.getPatternOption(pattern)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class TimestampPattern implements LogPattern {
*/
@Nonnull
public static TimestampPattern from(@NonNull String pattern) {
if (!LogPatternType.TIMESTAMP.isTargetTypeOf(pattern)) {
if (!PatternType.TIMESTAMP.isTargetTypeOf(pattern)) {
throw new IllegalArgumentException("pattern: " + pattern);
}
DateTimeFormatter dateTimeFormatter = LogPattern.getPatternOption(pattern)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ public class VerbatimPattern implements LogPattern {
*/
@Nonnull
public static VerbatimPattern from(String pattern) {
if (!LogPatternType.VERBATIM.isTargetTypeOf(pattern)) {
if (!PatternType.VERBATIM.isTargetTypeOf(pattern)) {
throw new IllegalArgumentException(String.format(
"pattern '%s' looks to be targeted at another known pattern type than %s",
pattern,
LogPatternType.VERBATIM));
PatternType.VERBATIM));
}
return new VerbatimPattern(pattern);
}
Expand Down

0 comments on commit fc64556

Please sign in to comment.