2 * ============LICENSE_START=======================================================
3 * oom-certservice-client
4 * ================================================================================
5 * Copyright (C) 2020 Nokia. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.onap.oom.certservice.client.configuration.model;
23 import java.util.Objects;
25 public final class San {
27 private final String value;
28 private final int type;
30 public San(String value, int type) {
35 public String getValue() {
39 public int getType() {
43 public String toString() {
44 return "{SAN value: " + value + ", type: " + getReadableType(type) + '}';
47 public boolean equals(Object o) {
51 if (o == null || getClass() != o.getClass()) {
55 return type == san1.type &&
56 Objects.equals(value, san1.value);
59 public int hashCode() {
60 return Objects.hash(value, type);
63 private String getReadableType(int type) {
64 String readableType = "undefined";
66 case 1: readableType = "rfc822Name"; break;
67 case 2: readableType = "dNSName"; break;
68 case 6: readableType = "uniformResourceIdentifier"; break;
69 case 7: readableType = "iPAddress"; break;