blob: e3ca1fb9a0b01e683d6ed3078685ce76ca80fdce [file] [log] [blame]
Brian Stanke9bf8d7c2016-02-11 10:17:23 -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
17package org.onosproject.incubator.net.key;
18
19/**
20 * Representation of a username and password.
21 */
22public final class UsernamePassword extends DeviceKey {
23 private final String username;
24 private final String password;
25
26 /**
27 * Private constructor for a username and password.
28 *
29 * @param username user's name
30 * @param password user's password
31 */
32 private UsernamePassword(String username, String password) {
33 this.username = username;
34 this.password = password;
35 }
36
37 /**
38 * Static method to construct a username / password.
39 *
40 * @param username user's name
41 * @param password user's password
42 * @return username and password
43 */
44 static UsernamePassword usernamePassword(String username, String password) {
45 return new UsernamePassword(username, password);
46 }
47
48 /**
49 * Returns the username.
50 *
51 * @return username
52 */
53 public String username() {
54 return username;
55 }
56
57 /**
58 * Returns the password.
59 *
60 * @return password
61 */
62 public String password() {
63 return password;
64 }
65}