Skip to content

Commit

Permalink
feat: create beer
Browse files Browse the repository at this point in the history
Signed-off-by: Otavio Santana <[email protected]>
  • Loading branch information
otaviojava committed Dec 24, 2024
1 parent d6abed2 commit 09055da
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions tck/src/main/java/jakarta/nosql/tck/entities/Beer.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@

import jakarta.nosql.Column;
import jakarta.nosql.DiscriminatorValue;
import jakarta.nosql.Entity;
import net.datafaker.Faker;

@DiscriminatorValue("BEER")
@Entity
public class Beer extends Drink {

@Column
Expand All @@ -29,4 +32,35 @@ public class Beer extends Drink {

@Column
private String style;

public String getBrand() {
return brand;
}

public String getName() {
return name;
}

public String getStyle() {
return style;
}

@Override
public String toString() {
return "Beer{" +
"brand='" + brand + '\'' +
", name='" + name + '\'' +
", style='" + style + '\'' +
", id='" + id + '\'' +
'}';
}

public static Beer of(Faker faker) {
Beer beer = new Beer();
beer.id = faker.idNumber().valid();
beer.brand = faker.beer().brand();
beer.name = faker.beer().name();
beer.style = faker.beer().style();
return beer;
}
}

0 comments on commit 09055da

Please sign in to comment.