igalshilman commented on a change in pull request #206: URL: https://github.com/apache/flink-statefun/pull/206#discussion_r586291915
########## File path: statefun-sdk-java/src/test/java/org/apache/flink/statefun/sdk/java/types/SimpleTypeTest.java ########## @@ -0,0 +1,63 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.flink.statefun.sdk.java.types; + +import static org.hamcrest.core.Is.is; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThat; + +import org.apache.flink.statefun.sdk.java.TypeName; +import org.apache.flink.statefun.sdk.java.slice.Slice; +import org.junit.Test; + +public class SimpleTypeTest { + + @Test + public void mutableType() { Review comment: Minor comment here, regarding `String::getBytes`: I know that this is irrelevant for this test in particular, but since this is part of the SDK test, I wouldn't want users to get the wrong impression that this is how we recommend dealing with String (folks have the habit to copy paste :-P) Can you replace the method references with a version that accepts a UTF8 charset? ########## File path: statefun-sdk-java/src/main/java/org/apache/flink/statefun/sdk/java/types/SimpleType.java ########## @@ -47,14 +47,14 @@ private final TypeSerializer<T> serializer; private final Set<TypeCharacteristics> typeCharacteristics; - public SimpleType( + private SimpleType( TypeName typeName, Fn<T, byte[]> serialize, Fn<byte[], T> deserialize, Set<TypeCharacteristics> typeCharacteristics) { this.typeName = Objects.requireNonNull(typeName); this.serializer = new Serializer<>(serialize, deserialize); - this.typeCharacteristics = Collections.unmodifiableSet(EnumSet.copyOf(typeCharacteristics)); Review comment: 👍 ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org