-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #316 from muehmar/312-option-to-confirm-mapping-wi…
…thout-conversion 312 option to confirm mapping without conversion
- Loading branch information
Showing
9 changed files
with
117 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 14 additions & 1 deletion
15
.../src/main/java/com/github/muehmar/gradle/openapi/generator/settings/ClassTypeMapping.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,36 @@ | ||
package com.github.muehmar.gradle.openapi.generator.settings; | ||
|
||
import static com.github.muehmar.gradle.openapi.util.Booleans.not; | ||
|
||
import io.github.muehmar.pojobuilder.annotations.Nullable; | ||
import io.github.muehmar.pojobuilder.annotations.PojoBuilder; | ||
import java.io.Serializable; | ||
import java.util.Optional; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Value; | ||
|
||
@Value | ||
@AllArgsConstructor | ||
@PojoBuilder | ||
public class ClassTypeMapping implements Serializable { | ||
String fromClass; | ||
String toClass; | ||
TypeConversion typeConversion; | ||
@Nullable TypeConversion typeConversion; | ||
boolean disableMissingConversionWarning; | ||
|
||
public ClassTypeMapping( | ||
String fromClass, String toClass, Optional<TypeConversion> typeConversion) { | ||
this.fromClass = fromClass; | ||
this.toClass = toClass; | ||
this.typeConversion = typeConversion.orElse(null); | ||
this.disableMissingConversionWarning = false; | ||
} | ||
|
||
public Optional<TypeConversion> getTypeConversion() { | ||
return Optional.ofNullable(typeConversion); | ||
} | ||
|
||
public boolean isMissingConversionWarningEnabled() { | ||
return not(disableMissingConversionWarning); | ||
} | ||
} |
15 changes: 14 additions & 1 deletion
15
plugin/src/main/java/com/github/muehmar/gradle/openapi/generator/settings/DtoMapping.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,35 @@ | ||
package com.github.muehmar.gradle.openapi.generator.settings; | ||
|
||
import static com.github.muehmar.gradle.openapi.util.Booleans.not; | ||
|
||
import io.github.muehmar.pojobuilder.annotations.Nullable; | ||
import io.github.muehmar.pojobuilder.annotations.PojoBuilder; | ||
import java.io.Serializable; | ||
import java.util.Optional; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Value; | ||
|
||
@Value | ||
@AllArgsConstructor | ||
@PojoBuilder | ||
public class DtoMapping implements Serializable { | ||
String dtoName; | ||
String customType; | ||
TypeConversion typeConversion; | ||
@Nullable TypeConversion typeConversion; | ||
boolean disableMissingConversionWarning; | ||
|
||
public DtoMapping(String dtoName, String customType, Optional<TypeConversion> typeConversion) { | ||
this.dtoName = dtoName; | ||
this.customType = customType; | ||
this.typeConversion = typeConversion.orElse(null); | ||
this.disableMissingConversionWarning = false; | ||
} | ||
|
||
public Optional<TypeConversion> getTypeConversion() { | ||
return Optional.ofNullable(typeConversion); | ||
} | ||
|
||
public boolean isMissingConversionWarningEnabled() { | ||
return not(disableMissingConversionWarning); | ||
} | ||
} |
15 changes: 14 additions & 1 deletion
15
...src/main/java/com/github/muehmar/gradle/openapi/generator/settings/FormatTypeMapping.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,36 @@ | ||
package com.github.muehmar.gradle.openapi.generator.settings; | ||
|
||
import static com.github.muehmar.gradle.openapi.util.Booleans.not; | ||
|
||
import io.github.muehmar.pojobuilder.annotations.Nullable; | ||
import io.github.muehmar.pojobuilder.annotations.PojoBuilder; | ||
import java.io.Serializable; | ||
import java.util.Optional; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Value; | ||
|
||
@Value | ||
@AllArgsConstructor | ||
@PojoBuilder | ||
public class FormatTypeMapping implements Serializable { | ||
String formatType; | ||
String classType; | ||
TypeConversion typeConversion; | ||
@Nullable TypeConversion typeConversion; | ||
boolean disableMissingConversionWarning; | ||
|
||
public FormatTypeMapping( | ||
String formatType, String classType, Optional<TypeConversion> typeConversion) { | ||
this.formatType = formatType; | ||
this.classType = classType; | ||
this.typeConversion = typeConversion.orElse(null); | ||
this.disableMissingConversionWarning = false; | ||
} | ||
|
||
public Optional<TypeConversion> getTypeConversion() { | ||
return Optional.ofNullable(typeConversion); | ||
} | ||
|
||
public boolean isMissingConversionWarningEnabled() { | ||
return not(disableMissingConversionWarning); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters