Skip to content

Commit

Permalink
Fix nonsensical name
Browse files Browse the repository at this point in the history
  • Loading branch information
lukebemish committed May 27, 2024
1 parent 4650f0f commit afcb641
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public interface DataElementType<D, T> {
Codec<T> codec();
String name();

static <D, T> DataElementType<D, T> defaulted(String name, Codec<T> codec, Function<D, DataElement<T>> getter) {
static <D, T> DataElementType<D, T> create(String name, Codec<T> codec, Function<D, DataElement<T>> getter) {
return new DataElementType<>() {
@Override
public DataElement<T> from(D data) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
public interface StreamDataElementType<B, D, T> extends DataElementType<D, T> {
StreamCodec<B, T> streamCodec();

static <B, D, T> StreamDataElementType<B, D, T> defaulted(String name, Codec<T> codec, StreamCodec<B, T> streamCodec, Function<D, DataElement<T>> getter) {
static <B, D, T> StreamDataElementType<B, D, T> create(String name, Codec<T> codec, StreamCodec<B, T> streamCodec, Function<D, DataElement<T>> getter) {
return new StreamDataElementType<>() {
@Override
public StreamCodec<B, T> streamCodec() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

class TestDataElements {
private static class WithDataElements {
private static final DataElementType<WithDataElements, String> STRING = DataElementType.defaulted("string", Codec.STRING, d -> d.string);
private static final DataElementType<WithDataElements, Integer> INTEGER = DataElementType.defaulted("integer", Codec.INT, d -> d.integer);
private static final DataElementType<WithDataElements, String> STRING = DataElementType.create("string", Codec.STRING, d -> d.string);
private static final DataElementType<WithDataElements, Integer> INTEGER = DataElementType.create("integer", Codec.INT, d -> d.integer);
private static final Codec<Asymmetry<Consumer<WithDataElements>, WithDataElements>> CODEC = DataElementType.codec(true, STRING, INTEGER);
private static final Codec<Asymmetry<Consumer<WithDataElements>, WithDataElements>> CHANGED_CODEC = DataElementType.codec(false, STRING, INTEGER);

Expand Down

0 comments on commit afcb641

Please sign in to comment.