Java List Remove Duplicate removeDuplicate(List uidList)

Here you can find the source of removeDuplicate(List uidList)

Description

Remove duplicates in a list of rooms

License

Open Source License

Parameter

Parameter Description
uidList The list to check

Return

The list with unique ids without duplicates

Declaration

public static List<String> removeDuplicate(List<String> uidList) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.*;

public class Main {
    /**/*  w  w  w . j av  a  2 s  .c  o  m*/
     * Remove duplicates in a list of rooms
     *
     * @param uidList The list to check
     * @return The list with unique ids without duplicates
     */
    public static List<String> removeDuplicate(List<String> uidList) {
        HashSet<String> uidSet = new HashSet<String>();
        uidSet.addAll(uidList);
        return new ArrayList<String>(uidSet);
    }
}

Related

  1. removeDublicates(List l)
  2. removeDup(List lst)
  3. removeDuplicate(Collection entityList)
  4. removeDuplicate(List dest, List src)
  5. removeDuplicates(int[] list)
  6. removeDuplicates(List list)
  7. removeDuplicates(List listofthings)