blob: 3c3e29eac28c8e9af132c6d80a59924b1c418876 [file] [log] [blame]
Brian Stanke2b4f32d2016-02-03 14:22:10 -05001/*
2 * Copyright 2016 Open Networking Laboratory
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
Claudine Chiu31ad5272016-02-17 20:56:24 +000017package org.onosproject.net.key;
Brian Stanke2b4f32d2016-02-03 14:22:10 -050018
19/**
20 * Representation of an SNMP community name authentication token.
21 */
Brian Stanke9bf8d7c2016-02-11 10:17:23 -050022public final class CommunityName extends DeviceKey {
Brian Stanke2b4f32d2016-02-03 14:22:10 -050023 private final String name;
24
25 /**
26 * Private constructor for a community name.
27 *
28 * @param name community name
29 */
30 private CommunityName(String name) {
31 this.name = name;
32 }
33
34 /**
35 * Static method to construct a community name.
36 *
37 * @param name community name
38 * @return community name
39 */
40 static CommunityName communityName(String name) {
41 return new CommunityName(name);
42 }
43
44 /**
45 * Returns the community name.
46 *
47 * @return name
48 */
49 public String name() {
50 return name;
51 }
52}