@@ -0,0 +1,2032 @@
+/*%0A * Copyright 2010-2016 Steve Chaloner%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage be.objectify.deadbolt.java.models;%0A%0Aimport java.io.Serializable;%0Aimport java.util.ArrayList;%0Aimport java.util.Collections;%0Aimport java.util.List;%0Aimport java.util.stream.Collectors;%0A%0A/**%0A * Default implementation of a Subject.%0A *%0A * @author Steve Chaloner (steve@objectify.be)%0A */%0Apublic class DefaultSubject implements Subject, Serializable%0A%7B%0A%0A    private static final long serialVersionUID = 4340914517470685171L;%0A%0A    private final String identifier;%0A    private final List%3C? extends Role%3E roles;%0A    private final List%3C? extends Permission%3E permissions;%0A%0A    public DefaultSubject(final String identifier, final List%3CString%3E roles, final List%3CString%3E permissions)%0A    %7B%0A        this.identifier = identifier;%0A        this.roles = (roles != null) ? Collections.unmodifiableList(roles.stream().%3CRole%3Emap(role -%3E () -%3E role).collect(Collectors.toCollection(() -%3E new ArrayList%3C%3E()))) : null;%0A        this.permissions = (permissions != null) ? Collections.unmodifiableList(permissions.stream().%3CPermission%3Emap(permission -%3E () -%3E permission).collect(Collectors.toCollection(() -%3E new ArrayList%3C%3E()))) : null;%0A    %7D%0A%0A    @Override%0A    public String getIdentifier()%0A    %7B%0A        return this.identifier;%0A    %7D%0A%0A    @Override%0A    public List%3C? extends Role%3E getRoles()%0A    %7B%0A        return this.roles;%0A    %7D%0A%0A    @Override%0A    public List%3C? extends Permission%3E getPermissions()%0A    %7B%0A        return this.permissions;%0A    %7D%0A%7D%0A

Add generic DefaultSubject