/** * Set the quiet local auth property to the given value if the user hasn't already set this property. * * @param optionMap the option map * @param useQuietAuth the value to set the quiet local auth property to * @return the option map with the quiet local auth property set to the given value if the user hasn't already set this property */ private static OptionMap setQuietLocalAuth(final OptionMap optionMap, final boolean useQuietAuth) { final Sequence<Property> existingSaslProps = optionMap.get(Options.SASL_PROPERTIES); if (existingSaslProps != null) { for (Property prop : existingSaslProps) { final String propKey = prop.getKey(); if (propKey.equals(LocalUserClient.QUIET_AUTH) || propKey.equals(LocalUserClient.LEGACY_QUIET_AUTH)) { // quiet local auth property was already set, do not override it return optionMap; } } // set the quiet local auth property since it wasn't already set in SASL_PROPERTIES existingSaslProps.add(Property.of(LocalUserClient.QUIET_AUTH, Boolean.toString(useQuietAuth))); return optionMap; } // set the quiet local auth property since no SASL_PROPERTIES were set final OptionMap.Builder updatedOptionMapBuilder = OptionMap.builder().addAll(optionMap); updatedOptionMapBuilder.set(Options.SASL_PROPERTIES, Sequence.of(Property.of(LocalUserClient.QUIET_AUTH, Boolean.toString(useQuietAuth)))); return updatedOptionMapBuilder.getMap(); }
/** * Set the quiet local auth property to the given value if the user hasn't already set this property. * * @param optionMap the option map * @param useQuietAuth the value to set the quiet local auth property to * @return the option map with the quiet local auth property set to the given value if the user hasn't already set this property */ private static OptionMap setQuietLocalAuth(final OptionMap optionMap, final boolean useQuietAuth) { final Sequence<Property> existingSaslProps = optionMap.get(Options.SASL_PROPERTIES); if (existingSaslProps != null) { for (Property prop : existingSaslProps) { final String propKey = prop.getKey(); if (propKey.equals(LocalUserClient.QUIET_AUTH) || propKey.equals(LocalUserClient.LEGACY_QUIET_AUTH)) { // quiet local auth property was already set, do not override it return optionMap; } } // set the quiet local auth property since it wasn't already set in SASL_PROPERTIES existingSaslProps.add(Property.of(LocalUserClient.QUIET_AUTH, Boolean.toString(useQuietAuth))); return optionMap; } // set the quiet local auth property since no SASL_PROPERTIES were set final OptionMap.Builder updatedOptionMapBuilder = OptionMap.builder().addAll(optionMap); updatedOptionMapBuilder.set(Options.SASL_PROPERTIES, Sequence.of(Property.of(LocalUserClient.QUIET_AUTH, Boolean.toString(useQuietAuth)))); return updatedOptionMapBuilder.getMap(); } }
Bitmap bm = BitmapFactory.decodeResource(getResources(), R.drawable.star); int width = bm.getWidth(); int height = bm.getHeight(); RgbImage jjImage = RgbImageAndroid.toRgbImage(bm); Sequence seq = new Sequence(); seq.add(new Rgb3x3Average()); RgbImage jjImageResult = null; try { seq.push(jjImage.clone()); jjImageResult = (RgbImage) seq.getFront(); } catch (Error e) { // TODO Auto-generated catch block e.printStackTrace(); } int[] jjpixel = jjImageResult.getData(); Bitmap bm2 = bm.copy(bm.getConfig(), true); bm2.setPixels(jjpixel, 0, width, 0, 0, width, height);
/** * Set the quiet local auth property to the given value if the user hasn't already set this property. * * @param optionMap the option map * @param useQuietAuth the value to set the quiet local auth property to * @return the option map with the quiet local auth property set to the given value if the user hasn't already set this property */ private static OptionMap setQuietLocalAuth(final OptionMap optionMap, final boolean useQuietAuth) { final Sequence<Property> existingSaslProps = optionMap.get(Options.SASL_PROPERTIES); if (existingSaslProps != null) { for (Property prop : existingSaslProps) { final String propKey = prop.getKey(); if (propKey.equals(LocalUserClient.QUIET_AUTH) || propKey.equals(LocalUserClient.LEGACY_QUIET_AUTH)) { // quiet local auth property was already set, do not override it return optionMap; } } // set the quiet local auth property since it wasn't already set in SASL_PROPERTIES existingSaslProps.add(Property.of(LocalUserClient.QUIET_AUTH, Boolean.toString(useQuietAuth))); return optionMap; } // set the quiet local auth property since no SASL_PROPERTIES were set final OptionMap.Builder updatedOptionMapBuilder = OptionMap.builder().addAll(optionMap); updatedOptionMapBuilder.set(Options.SASL_PROPERTIES, Sequence.of(Property.of(LocalUserClient.QUIET_AUTH, Boolean.toString(useQuietAuth)))); return updatedOptionMapBuilder.getMap(); }
/** * Set the quiet local auth property to the given value if the user hasn't already set this property. * * @param optionMap the option map * @param useQuietAuth the value to set the quiet local auth property to * @return the option map with the quiet local auth property set to the given value if the user hasn't already set this property */ private static OptionMap setQuietLocalAuth(final OptionMap optionMap, final boolean useQuietAuth) { final Sequence<Property> existingSaslProps = optionMap.get(Options.SASL_PROPERTIES); if (existingSaslProps != null) { for (Property prop : existingSaslProps) { final String propKey = prop.getKey(); if (propKey.equals(LocalUserClient.QUIET_AUTH) || propKey.equals(LocalUserClient.LEGACY_QUIET_AUTH)) { // quiet local auth property was already set, do not override it return optionMap; } } // set the quiet local auth property since it wasn't already set in SASL_PROPERTIES existingSaslProps.add(Property.of(LocalUserClient.QUIET_AUTH, Boolean.toString(useQuietAuth))); return optionMap; } // set the quiet local auth property since no SASL_PROPERTIES were set final OptionMap.Builder updatedOptionMapBuilder = OptionMap.builder().addAll(optionMap); updatedOptionMapBuilder.set(Options.SASL_PROPERTIES, Sequence.of(Property.of(LocalUserClient.QUIET_AUTH, Boolean.toString(useQuietAuth)))); return updatedOptionMapBuilder.getMap(); }
/** * Set the quiet local auth property to the given value if the user hasn't already set this property. * * @param optionMap the option map * @param useQuietAuth the value to set the quiet local auth property to * @return the option map with the quiet local auth property set to the given value if the user hasn't already set this property */ private static OptionMap setQuietLocalAuth(final OptionMap optionMap, final boolean useQuietAuth) { final Sequence<Property> existingSaslProps = optionMap.get(Options.SASL_PROPERTIES); if (existingSaslProps != null) { for (Property prop : existingSaslProps) { final String propKey = prop.getKey(); if (propKey.equals(LocalUserClient.QUIET_AUTH) || propKey.equals(LocalUserClient.LEGACY_QUIET_AUTH)) { // quiet local auth property was already set, do not override it return optionMap; } } // set the quiet local auth property since it wasn't already set in SASL_PROPERTIES existingSaslProps.add(Property.of(LocalUserClient.QUIET_AUTH, Boolean.toString(useQuietAuth))); return optionMap; } // set the quiet local auth property since no SASL_PROPERTIES were set final OptionMap.Builder updatedOptionMapBuilder = OptionMap.builder().addAll(optionMap); updatedOptionMapBuilder.set(Options.SASL_PROPERTIES, Sequence.of(Property.of(LocalUserClient.QUIET_AUTH, Boolean.toString(useQuietAuth)))); return updatedOptionMapBuilder.getMap(); } }
/** * Set the quiet local auth property to the given value if the user hasn't already set this property. * * @param optionMap the option map * @param useQuietAuth the value to set the quiet local auth property to * @return the option map with the quiet local auth property set to the given value if the user hasn't already set this property */ private static OptionMap setQuietLocalAuth(final OptionMap optionMap, final boolean useQuietAuth) { final Sequence<Property> existingSaslProps = optionMap.get(Options.SASL_PROPERTIES); if (existingSaslProps != null) { for (Property prop : existingSaslProps) { final String propKey = prop.getKey(); if (propKey.equals(LocalUserClient.QUIET_AUTH) || propKey.equals(LocalUserClient.LEGACY_QUIET_AUTH)) { // quiet local auth property was already set, do not override it return optionMap; } } // set the quiet local auth property since it wasn't already set in SASL_PROPERTIES existingSaslProps.add(Property.of(LocalUserClient.QUIET_AUTH, Boolean.toString(useQuietAuth))); return optionMap; } // set the quiet local auth property since no SASL_PROPERTIES were set final OptionMap.Builder updatedOptionMapBuilder = OptionMap.builder().addAll(optionMap); updatedOptionMapBuilder.set(Options.SASL_PROPERTIES, Sequence.of(Property.of(LocalUserClient.QUIET_AUTH, Boolean.toString(useQuietAuth)))); return updatedOptionMapBuilder.getMap(); } }