// Step 1: Locate our spinner control and save it to the class for convenience // You could get it every time, I'm just being lazy... :-) spinner = (Spinner)this.findViewById(R.id.Spinner01); // Step 2: Create and fill an ArrayAdapter with a bunch of "State" objects ArrayAdapter spinnerArrayAdapter = new ArrayAdapter(this, android.R.layout.simple_spinner_item, new State[] { new State( 1, "Minnesota", "MN" ), new State( 99, "Wisconsin", "WI" ), new State( 53, "Utah", "UT" ), new State( 153, "Texas", "TX" ) }); // Step 3: Tell the spinner about our adapter spinner.setAdapter(spinnerArrayAdapter);
/** * Returns the OpenId Connect client id. * * @return client id */ public String getClientId() { return identityProvider.getClientId().getValue(); }
/** * Initiates an OpenId Connection authorization code flow using the specified request identifier to maintain state. * * @param oidcRequestIdentifier request identifier * @return state */ public State createState(final String oidcRequestIdentifier) { if (!isOidcEnabled()) { throw new IllegalStateException(OPEN_ID_CONNECT_SUPPORT_IS_NOT_CONFIGURED); } final CacheKey oidcRequestIdentifierKey = new CacheKey(oidcRequestIdentifier); final State state = new State(generateStateValue()); try { synchronized (stateLookupForPendingRequests) { final State cachedState = stateLookupForPendingRequests.get(oidcRequestIdentifierKey, () -> state); if (!timeConstantEqualityCheck(state.getValue(), cachedState.getValue())) { throw new IllegalStateException("An existing login request is already in progress."); } } } catch (ExecutionException e) { throw new IllegalStateException("Unable to store the login request state."); } return state; }
throw new RuntimeException("Client ID is required when configuring an OIDC Provider."); clientId = new ClientID(rawClientId);
/** * Validates the proposed state with the given request identifier. Will return false if the * state does not match or if entry for this request identifier has expired. * * @param oidcRequestIdentifier request identifier * @param proposedState proposed state * @return whether the state is valid or not */ public boolean isStateValid(final String oidcRequestIdentifier, final State proposedState) { if (!isOidcEnabled()) { throw new IllegalStateException(OPEN_ID_CONNECT_SUPPORT_IS_NOT_CONFIGURED); } if (proposedState == null) { throw new IllegalArgumentException("Proposed state must be specified."); } final CacheKey oidcRequestIdentifierKey = new CacheKey(oidcRequestIdentifier); synchronized (stateLookupForPendingRequests) { final State state = stateLookupForPendingRequests.getIfPresent(oidcRequestIdentifierKey); if (state != null) { stateLookupForPendingRequests.invalidate(oidcRequestIdentifierKey); } return state != null && timeConstantEqualityCheck(state.getValue(), proposedState.getValue()); } }
String openidConfiguration = getOpenidConfiguration(issuer); OIDCProviderMetadata metadata = parse(openidConfiguration); String metadataIssuer = metadata.getIssuer().getValue(); if (!issuer.equals(metadataIssuer)) { throw new IllegalStateException("The Issuer \"" + metadataIssuer + "\" provided in the OpenID Configuration did not match the requested issuer \"" + issuer + "\"");
public void addState() { try { State state=new State(); state.setStateName("Delhi"); stateDao.create(state); addCity(); addCustomer(); } catch(Exception e) { e.printStackTrace(); } }
public class IntPair { private final int x, y; /* Constructor, getters */ } // Creation: for(int x = 0; x < width; x++) { for(int y = 0; y < height; y++) { Actor actor = new Actor(); actor.setUserObject(new IntPair(x, y)); } } // Accessing index: IntPair index = (IntPair) actor.getUserObject();
private void installListener() { if (broadcastReceiver == null) { broadcastReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { Bundle extras = intent.getExtras(); NetworkInfo info = (NetworkInfo) extras .getParcelable("networkInfo"); State state = info.getState(); Log.d("InternalBroadcastReceiver", info.toString() + " " + state.toString()); if (state == State.CONNECTED) { onNetworkUp(); } else { onNetworkDown(); } } }; final IntentFilter intentFilter = new IntentFilter(); intentFilter.addAction(ConnectivityManager.CONNECTIVITY_ACTION); registerReceiver(broadcastReceiver, intentFilter); } }
private Actor actionManager = new Actor(); //when creating actions: actionManager.addAction(repeatAction); //In render(), use this instead of calling act on individual actions //It will call act on all actions in the actor: actionManager.act(Gdx.graphics.getDeltaTime());
ClientID clientId = new ClientID(clientRegistration.getClientId()); Secret clientSecret = new Secret(clientRegistration.getClientSecret()); ClientAuthentication clientAuthentication;
State one = new State("one"); State two = new State("two"); State three = new State("three"); Condition sunday = new Condition("Sunday"); Condition raining = new Condition("Raining"); Condition notSunday = new Condition("Not Sunday"); Condition notRaining = new Condition("Not Raining"); List<Transition> transitions = new ArrayList<Transition>(); transitions.add(one, new Set(sunday), three); transitions.add(one, new Set(sunday), two); // <<--- Invalid, cant go to two and three transitions.add(one, new Set(raining), three); transitions.add(one, new Set(sunday, raining), three); transitions.add(one, new Set(notSunday, notRaining), three); StateMachine machine = new StateMachine(one, transitions); System.out.print(machine.current); // "one" machine.apply(new Set(sunday, raining)); System.out.print(machine.current); // "three
.queryParam("response_type", "code") .queryParam("scope", oidcService.getScope().toString()) .queryParam("state", state.getValue()) .queryParam("redirect_uri", getOidcCallback()) .build();
final LoginAuthenticationToken loginToken = new LoginAuthenticationToken(email, email, expiresIn, claimsSet.getIssuer().getValue()); return jwtService.generateSignedToken(loginToken); } else {
public void addState() { State state=new State(); state.setStateName("Delhi"); stateDao.create(state); addCity(); addCustomer(); }
public Test() { test1[1][1] = new State(); test1[1][1].position = 1; .... }
private State USA = new State("United States of America"); private State CAN = new State("Canada"); private State MEX = new State("Mexico"); private ArrayList<State> stateArray = new ArrayList<State>; public static void main() { } public void addState(State state) //I need a way to add the Private objects called State into an array here. The command must take User Interface { stateArray.add(state); }
public class MessagePresenter { private void setMessage() { // logic here State state = new State(true, "Hello from the server"); view().setMessage(state); } }