Skip to content

Commit

Permalink
fix linter issues
Browse files Browse the repository at this point in the history
Signed-off-by: Jalander Ramagiri <jalander.ramagiri@est.tech>
  • Loading branch information
Jalander Ramagiri committed Jul 4, 2024
1 parent aab785a commit 67d2b79
Show file tree
Hide file tree
Showing 48 changed files with 62 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public class {{capitalizedSubject}}{{capitalizedPredicate}}CDEvent extends {{cap
* @return custom schema URI
*/
@Override
public URI customSchemaUri(){
public URI customSchemaUri() {
return getContext().getSchemaUri();
}

Expand Down
22 changes: 15 additions & 7 deletions sdk/src/main/java/dev/cdevents/CDEvents.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ public static boolean validateCDEvent(CDEvent cdEvent) {

/**
* Creates cdEvent from cdEventJson string and validates against schema.
* @param cdEventJson
* @return CDEvent, needs type casting to specific CDEvent class
* @param cdEventJson json string of any CDEvent type
* @return CDEvent needs type casting to specific CDEvent class
*/
public static CDEvent cdEventFromJson(String cdEventJson) {
String eventType = getUnVersionedEventTypeFromJson(cdEventJson);
Expand All @@ -110,8 +110,9 @@ public static CDEvent cdEventFromJson(String cdEventJson) {
}

/**
* Creates a CloudEvent from the custom cdEvent
* @param customCDEvent
* Creates a CloudEvent from the custom cdEvent.
* @param customCDEvent custom CDEvent class object
* @param validateContextSchema true If validation needed against context.schemaUri
* @return CloudEvent
*/
public static <T extends CDEvent> CloudEvent customCDEventAsCloudEvent(T customCDEvent, boolean validateContextSchema) {
Expand All @@ -127,6 +128,13 @@ public static <T extends CDEvent> CloudEvent customCDEventAsCloudEvent(T customC
}
}

/**
* Creates customCDEvent from Json string and validates against context and official schemas.
* @param customCDEventJson Json string of customCDEvent class type <T>
* @param eventClass customCDEvent class type <T>
* @param validateContextSchema true If validation needed against context.schemaUri
* @return CDEvent
*/
public static <T extends CDEvent> T customCDEventFromJson(String customCDEventJson, Class<T> eventClass, boolean validateContextSchema) {
try {
T cdEvent = new ObjectMapper().readValue(customCDEventJson, eventClass);
Expand All @@ -141,8 +149,8 @@ public static <T extends CDEvent> T customCDEventFromJson(String customCDEventJs

/**
* Validates the custom CDEvent against the official and context schemas.
* @param customCDEvent, custom CDEvent to validate
* @param validateContextSchema, true to validate custom CDEvent against context schema
* @param customCDEvent custom CDEvent to validate
* @param validateContextSchema true to validate custom CDEvent against context schema
* @return valid cdEvent
*/
public static boolean validateCustomCDEvent(CDEvent customCDEvent, boolean validateContextSchema) {
Expand All @@ -155,7 +163,7 @@ public static boolean validateCustomCDEvent(CDEvent customCDEvent, boolean valid

/**
* Validates the custom CDEvent against the provided context Schema URI.
* @param customCDEvent, custom CDEvent to validate
* @param customCDEvent custom CDEvent to validate
* @return valid cdEvent
*/
public static boolean validateWithContextSchemaUri(CDEvent customCDEvent) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public String schemaFileName() {
* @return custom schema URI
*/
@Override
public URI customSchemaUri(){
public URI customSchemaUri() {
return getContext().getSchemaUri();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public String schemaFileName() {
* @return custom schema URI
*/
@Override
public URI customSchemaUri(){
public URI customSchemaUri() {
return getContext().getSchemaUri();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public String schemaFileName() {
* @return custom schema URI
*/
@Override
public URI customSchemaUri(){
public URI customSchemaUri() {
return getContext().getSchemaUri();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public String schemaFileName() {
* @return custom schema URI
*/
@Override
public URI customSchemaUri(){
public URI customSchemaUri() {
return getContext().getSchemaUri();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public String schemaFileName() {
* @return custom schema URI
*/
@Override
public URI customSchemaUri(){
public URI customSchemaUri() {
return getContext().getSchemaUri();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public String schemaFileName() {
* @return custom schema URI
*/
@Override
public URI customSchemaUri(){
public URI customSchemaUri() {
return getContext().getSchemaUri();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public String schemaFileName() {
* @return custom schema URI
*/
@Override
public URI customSchemaUri(){
public URI customSchemaUri() {
return getContext().getSchemaUri();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public String schemaFileName() {
* @return custom schema URI
*/
@Override
public URI customSchemaUri(){
public URI customSchemaUri() {
return getContext().getSchemaUri();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public String schemaFileName() {
* @return custom schema URI
*/
@Override
public URI customSchemaUri(){
public URI customSchemaUri() {
return getContext().getSchemaUri();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public String schemaFileName() {
* @return custom schema URI
*/
@Override
public URI customSchemaUri(){
public URI customSchemaUri() {
return getContext().getSchemaUri();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public String schemaFileName() {
* @return custom schema URI
*/
@Override
public URI customSchemaUri(){
public URI customSchemaUri() {
return getContext().getSchemaUri();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public String schemaFileName() {
* @return custom schema URI
*/
@Override
public URI customSchemaUri(){
public URI customSchemaUri() {
return getContext().getSchemaUri();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public String schemaFileName() {
* @return custom schema URI
*/
@Override
public URI customSchemaUri(){
public URI customSchemaUri() {
return getContext().getSchemaUri();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public String schemaFileName() {
* @return custom schema URI
*/
@Override
public URI customSchemaUri(){
public URI customSchemaUri() {
return getContext().getSchemaUri();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public String schemaFileName() {
* @return custom schema URI
*/
@Override
public URI customSchemaUri(){
public URI customSchemaUri() {
return getContext().getSchemaUri();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public String schemaFileName() {
* @return custom schema URI
*/
@Override
public URI customSchemaUri(){
public URI customSchemaUri() {
return getContext().getSchemaUri();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public String schemaFileName() {
* @return custom schema URI
*/
@Override
public URI customSchemaUri(){
public URI customSchemaUri() {
return getContext().getSchemaUri();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public String schemaFileName() {
* @return custom schema URI
*/
@Override
public URI customSchemaUri(){
public URI customSchemaUri() {
return getContext().getSchemaUri();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public String schemaFileName() {
* @return custom schema URI
*/
@Override
public URI customSchemaUri(){
public URI customSchemaUri() {
return getContext().getSchemaUri();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public String schemaFileName() {
* @return custom schema URI
*/
@Override
public URI customSchemaUri(){
public URI customSchemaUri() {
return getContext().getSchemaUri();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public String schemaFileName() {
* @return custom schema URI
*/
@Override
public URI customSchemaUri(){
public URI customSchemaUri() {
return getContext().getSchemaUri();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public String schemaFileName() {
* @return custom schema URI
*/
@Override
public URI customSchemaUri(){
public URI customSchemaUri() {
return getContext().getSchemaUri();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public String schemaFileName() {
* @return custom schema URI
*/
@Override
public URI customSchemaUri(){
public URI customSchemaUri() {
return getContext().getSchemaUri();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public String schemaFileName() {
* @return custom schema URI
*/
@Override
public URI customSchemaUri(){
public URI customSchemaUri() {
return getContext().getSchemaUri();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public String schemaFileName() {
* @return custom schema URI
*/
@Override
public URI customSchemaUri(){
public URI customSchemaUri() {
return getContext().getSchemaUri();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public String schemaFileName() {
* @return custom schema URI
*/
@Override
public URI customSchemaUri(){
public URI customSchemaUri() {
return getContext().getSchemaUri();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public String schemaFileName() {
* @return custom schema URI
*/
@Override
public URI customSchemaUri(){
public URI customSchemaUri() {
return getContext().getSchemaUri();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public String schemaFileName() {
* @return custom schema URI
*/
@Override
public URI customSchemaUri(){
public URI customSchemaUri() {
return getContext().getSchemaUri();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public String schemaFileName() {
* @return custom schema URI
*/
@Override
public URI customSchemaUri(){
public URI customSchemaUri() {
return getContext().getSchemaUri();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public String schemaFileName() {
* @return custom schema URI
*/
@Override
public URI customSchemaUri(){
public URI customSchemaUri() {
return getContext().getSchemaUri();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public String schemaFileName() {
* @return custom schema URI
*/
@Override
public URI customSchemaUri(){
public URI customSchemaUri() {
return getContext().getSchemaUri();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public String schemaFileName() {
* @return custom schema URI
*/
@Override
public URI customSchemaUri(){
public URI customSchemaUri() {
return getContext().getSchemaUri();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public String schemaFileName() {
* @return custom schema URI
*/
@Override
public URI customSchemaUri(){
public URI customSchemaUri() {
return getContext().getSchemaUri();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public String schemaFileName() {
* @return custom schema URI
*/
@Override
public URI customSchemaUri(){
public URI customSchemaUri() {
return getContext().getSchemaUri();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public String schemaFileName() {
* @return custom schema URI
*/
@Override
public URI customSchemaUri(){
public URI customSchemaUri() {
return getContext().getSchemaUri();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public String schemaFileName() {
* @return custom schema URI
*/
@Override
public URI customSchemaUri(){
public URI customSchemaUri() {
return getContext().getSchemaUri();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public String schemaFileName() {
* @return custom schema URI
*/
@Override
public URI customSchemaUri(){
public URI customSchemaUri() {
return getContext().getSchemaUri();
}

Expand Down
Loading

0 comments on commit 67d2b79

Please sign in to comment.