Skip to main content
summaryrefslogtreecommitdiffstats
blob: 156305e0dbc9793e50dbeb1a67c3b2b8781bc0b2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*******************************************************************************
 * Copyright (c) 2013 Boeing.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Boeing - initial API and implementation
 *******************************************************************************/
package org.eclipse.osee.authentication.admin.internal;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import org.eclipse.osee.authentication.admin.AuthenticatedUser;
import org.eclipse.osee.framework.jdk.core.util.Strings;

/**
 * @author Roberto E. Escobar
 */
public final class AuthenticationUtil {

   private AuthenticationUtil() {
      //
   }

   public static AuthenticatedUser newAnonymousUser() {
      return new AnonymousUser();
   }

   public static String normalize(String value) {
      return Strings.isValid(value) ? value.toLowerCase().trim() : value;
   }

   public static Iterable<String> unmodifiableSortedIterable(Collection<String> source) {
      List<String> list = new ArrayList<>();
      list.addAll(source);
      Collections.sort(list);
      return Collections.unmodifiableList(list);
   }

}

Back to the top