Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (C) 2015 Zalando SE (http://tech.zalando.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
package org.zalando.stups.tokens;
public class AccessTokenConfiguration {
    private final Object tokenId;
    private final AccessTokensBuilder accessTokensBuilder;
    private final Set<Objectscopes = new HashSet<Object>();
    private boolean locked = false;
    AccessTokenConfiguration(final Object tokenIdfinal AccessTokensBuilder accessTokensBuilder) {
        this. = tokenId;
        this. = accessTokensBuilder;
    }
    private void checkLock() {
        if () {
            throw new IllegalStateException("scope configuration already done");
        }
    }
    private void checkNotNull(final String namefinal Object obj) {
        if (obj == null) {
            throw new IllegalArgumentException(name + " must not be null");
        }
    }
    public AccessTokenConfiguration addScope(final Object scope) {
        checkLock();
        checkNotNull("scope"scope);
        .add(scope);
        return this;
    }
    public AccessTokenConfiguration addScopes(final Collection<Objectscopes) {
        checkLock();
        checkNotNull("scopes"scopes);
        this..addAll(scopes);
        return this;
    }
    Object getTokenId() {
        return ;
    }
    Set<ObjectgetScopes() {
        return Collections.unmodifiableSet();
    }
    public AccessTokensBuilder done() {
         = true;
        return ;
    }
New to GrepCode? Check out our FAQ X