-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates Infinispan to Protostream 5.0.0.Final
- Loading branch information
Showing
9 changed files
with
82 additions
and
208 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
45 changes: 3 additions & 42 deletions
45
...gration-tests/infinispan-client/src/main/java/io/quarkus/it/infinispan/client/Author.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,46 +1,7 @@ | ||
package io.quarkus.it.infinispan.client; | ||
|
||
import java.util.Objects; | ||
import org.infinispan.protostream.annotations.Proto; | ||
|
||
import org.infinispan.protostream.annotations.ProtoFactory; | ||
import org.infinispan.protostream.annotations.ProtoField; | ||
|
||
/** | ||
* @author William Burns | ||
*/ | ||
public class Author { | ||
private final String name; | ||
private final String surname; | ||
|
||
@ProtoFactory | ||
public Author(String name, String surname) { | ||
this.name = Objects.requireNonNull(name); | ||
this.surname = Objects.requireNonNull(surname); | ||
} | ||
|
||
@ProtoField(number = 1) | ||
public String getName() { | ||
return name; | ||
} | ||
|
||
@ProtoField(number = 2) | ||
public String getSurname() { | ||
return surname; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) | ||
return true; | ||
if (o == null || getClass() != o.getClass()) | ||
return false; | ||
Author author = (Author) o; | ||
return name.equals(author.name) && | ||
surname.equals(author.surname); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(name, surname); | ||
} | ||
@Proto | ||
public record Author(String name, String surname) { | ||
} |
80 changes: 5 additions & 75 deletions
80
integration-tests/infinispan-client/src/main/java/io/quarkus/it/infinispan/client/Book.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,86 +1,16 @@ | ||
package io.quarkus.it.infinispan.client; | ||
|
||
import java.math.BigDecimal; | ||
import java.util.Objects; | ||
import java.util.Set; | ||
|
||
import org.infinispan.api.annotations.indexing.Indexed; | ||
import org.infinispan.api.annotations.indexing.Keyword; | ||
import org.infinispan.api.annotations.indexing.Text; | ||
import org.infinispan.protostream.annotations.ProtoFactory; | ||
import org.infinispan.protostream.annotations.ProtoField; | ||
import org.infinispan.protostream.annotations.Proto; | ||
|
||
/** | ||
* @author William Burns | ||
*/ | ||
@Proto | ||
@Indexed | ||
public class Book { | ||
private final String title; | ||
private final String description; | ||
private final int publicationYear; | ||
private final Set<Author> authors; | ||
private final Type bookType; | ||
private final BigDecimal price; | ||
|
||
@ProtoFactory | ||
public Book(String title, String description, int publicationYear, Set<Author> authors, Type bookType, BigDecimal price) { | ||
this.title = Objects.requireNonNull(title); | ||
this.description = Objects.requireNonNull(description); | ||
this.publicationYear = publicationYear; | ||
this.authors = Objects.requireNonNull(authors); | ||
this.bookType = bookType; | ||
this.price = price; | ||
} | ||
|
||
@ProtoField(number = 1) | ||
@Text | ||
public String getTitle() { | ||
return title; | ||
} | ||
|
||
@ProtoField(number = 2) | ||
@Keyword(projectable = true, sortable = true, normalizer = "lowercase", indexNullAs = "unnamed", norms = false) | ||
public String getDescription() { | ||
return description; | ||
} | ||
|
||
@ProtoField(number = 3, defaultValue = "-1") | ||
public int getPublicationYear() { | ||
return publicationYear; | ||
} | ||
|
||
@ProtoField(number = 4) | ||
public Set<Author> getAuthors() { | ||
return authors; | ||
} | ||
|
||
@ProtoField(number = 5) | ||
public Type getBookType() { | ||
return bookType; | ||
} | ||
|
||
@ProtoField(number = 6) | ||
public BigDecimal getPrice() { | ||
return price; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) | ||
return true; | ||
if (o == null || getClass() != o.getClass()) | ||
return false; | ||
Book book = (Book) o; | ||
return publicationYear == book.publicationYear && | ||
title.equals(book.title) && | ||
description.equals(book.description) && | ||
authors.equals(book.authors) && | ||
bookType.equals(book.bookType) && | ||
price.equals(book.price); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(title, description, publicationYear, authors, bookType, price); | ||
} | ||
public record Book(@Text String title, | ||
@Keyword(projectable = true, sortable = true, normalizer = "lowercase", indexNullAs = "unnamed", norms = false) String description, | ||
int publicationYear, Set<Author> authors, Type bookType, BigDecimal price) { | ||
} |
4 changes: 2 additions & 2 deletions
4
...ests/infinispan-client/src/main/java/io/quarkus/it/infinispan/client/BookStoreSchema.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,10 +1,10 @@ | ||
package io.quarkus.it.infinispan.client; | ||
|
||
import org.infinispan.protostream.GeneratedSchema; | ||
import org.infinispan.protostream.annotations.AutoProtoSchemaBuilder; | ||
import org.infinispan.protostream.annotations.ProtoSchema; | ||
import org.infinispan.protostream.types.java.math.BigDecimalAdapter; | ||
|
||
@AutoProtoSchemaBuilder(includeClasses = { Book.class, Type.class, Author.class, | ||
@ProtoSchema(includeClasses = { Book.class, Type.class, Author.class, | ||
BigDecimalAdapter.class }, schemaPackageName = "book_sample") | ||
interface BookStoreSchema extends GeneratedSchema { | ||
} |
Oops, something went wrong.