private List < Owner > getOwners ( DashboardRemoteRequest request ) throws HygieiaException { DashboardRemoteRequest . DashboardMetaData metaData = request . getMetaData ( ) ; Owner owner = metaData . getOwner ( ) ; List < Owner > owners = metaData . getOwners ( ) ; if ( owner == null && CollectionUtils . isEmpty ( owners ) ) { throw new HygieiaException ( "There are no owner/owners field in the request" , HygieiaException . INVALID_CONFIGURATION ) ; } if ( owners == null ) { owners = new ArrayList < Owner > ( ) ; owners . add ( owner ) ; } else if ( owner != null ) { owners . add ( owner ) ; } Set < Owner > uniqueOwners = new HashSet < Owner > ( owners ) ; return new ArrayList < Owner > ( uniqueOwners ) ; }
Creates a list of unique owners from the owner and owners requests