Remove most of atomix.utils.*
[controller.git] / third-party / atomix / utils / src / main / java / io / atomix / utils / serializer / NamespaceTypeConfig.java
1 /*
2  * Copyright 2018-present Open Networking Foundation
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16 package io.atomix.utils.serializer;
17
18 import com.esotericsoftware.kryo.Serializer;
19 import io.atomix.utils.config.Config;
20
21 /**
22  * Namespace type configuration.
23  */
24 public class NamespaceTypeConfig implements Config {
25   private Class<?> type;
26   private Integer id;
27   private Class<? extends com.esotericsoftware.kryo.Serializer> serializer;
28
29   /**
30    * Returns the serializable type.
31    *
32    * @return the serializable type
33    */
34   public Class<?> getType() {
35     return type;
36   }
37
38   /**
39    * Sets the serializable type.
40    *
41    * @param type the serializable type
42    * @return the type configuration
43    */
44   public NamespaceTypeConfig setType(Class<?> type) {
45     this.type = type;
46     return this;
47   }
48
49   /**
50    * Returns the type identifier.
51    *
52    * @return the type identifier
53    */
54   public Integer getId() {
55     return id;
56   }
57
58   /**
59    * Sets the type identifier.
60    *
61    * @param id the type identifier
62    * @return the type configuration
63    */
64   public NamespaceTypeConfig setId(Integer id) {
65     this.id = id;
66     return this;
67   }
68
69   /**
70    * Returns the serializer class.
71    *
72    * @return the serializer class
73    */
74   public Class<? extends Serializer> getSerializer() {
75     return serializer;
76   }
77
78   /**
79    * Sets the serializer class.
80    *
81    * @param serializer the serializer class
82    * @return the type configuration
83    */
84   public NamespaceTypeConfig setSerializer(Class<? extends Serializer> serializer) {
85     this.serializer = serializer;
86     return this;
87   }
88 }