Skip to content

Commit

Permalink
refactored setExample method on mediatype class
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoMario committed Jun 22, 2021
1 parent 1ac81fc commit f18169a
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,15 @@ public Object getExample() {
}

public void setExample(Object example) {
this.example = example;
exampleSetFlag = true;
if (this.schema == null) {
this.example = example;
this.exampleSetFlag = true;
return;
}
this.example = this.schema.cast(example);
if (!(example != null && this.example == null)) {
this.exampleSetFlag = true;
}
}

public MediaType example(Object example) {
Expand Down

0 comments on commit f18169a

Please sign in to comment.