2 * Copyright 2018-present Open Networking Foundation
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package io.atomix.utils.serializer;
18 import com.esotericsoftware.kryo.Serializer;
19 import io.atomix.utils.config.Config;
22 * Namespace type configuration.
24 public class NamespaceTypeConfig implements Config {
25 private Class<?> type;
27 private Class<? extends com.esotericsoftware.kryo.Serializer> serializer;
30 * Returns the serializable type.
32 * @return the serializable type
34 public Class<?> getType() {
39 * Sets the serializable type.
41 * @param type the serializable type
42 * @return the type configuration
44 public NamespaceTypeConfig setType(Class<?> type) {
50 * Returns the type identifier.
52 * @return the type identifier
54 public Integer getId() {
59 * Sets the type identifier.
61 * @param id the type identifier
62 * @return the type configuration
64 public NamespaceTypeConfig setId(Integer id) {
70 * Returns the serializer class.
72 * @return the serializer class
74 public Class<? extends Serializer> getSerializer() {
79 * Sets the serializer class.
81 * @param serializer the serializer class
82 * @return the type configuration
84 public NamespaceTypeConfig setSerializer(Class<? extends Serializer> serializer) {
85 this.serializer = serializer;