Examples of Optional

A common alternative to using this class is to find or create a suitable null object for the type in question.

This class is not intended as a direct analogue of any existing "option" or "maybe" construct from other programming environments, though it may bear some similarities. @param < T> the type of instance that can be contained. {@code Optional} is naturallycovariant on this type, so it is safe to cast an {@code Optional} to {@code Optional} for any supertype {@code S} of {@code T}. @author Kurt Alfred Kluever @author Kevin Bourrillion @since Guava release 10

  • com.google.gwt.i18n.client.Messages.Optional
  • com.linkedin.restli.server.annotations.Optional
  • com.sun.star.beans.Optional
  • lupos.engine.operators.multiinput.optional.Optional
  • lupos.gui.operatorgraph.visualeditor.queryeditor.operators.Optional
  • net.sf.laja.parser.engine2.element.Optional
  • org.apache.isis.applib.annotation.Optional
  • org.eclipse.papyrus.sysml.activities.Optional
    A representation of the model object ' Optional'.

    The following features are supported:

    • {@link org.eclipse.papyrus.sysml.activities.Optional#getBase_Parameter Base Parameter}

    @see org.eclipse.papyrus.sysml.activities.ActivitiesPackage#getOptional() @model @generated
  • org.hamcrest.text.pattern.internal.ast.Optional
  • org.jrdf.query.expression.Optional
  • org.supercsv.cellprocessor.Optional
    This processor returns null if it meets the empty String in a column and does not call subsequent processors in its chain. It is a simple customization of the MagicToken. If you need to return different values than null, use that class instead. @author Kasper B. Graversen

  • Examples of com.google.common.base.Optional

          }
        };
      }

      public static void selectComboBoxItem(JComboBox jComboBox, String name) {
        Optional itemToSelect = Optional.absent();
        for (int i = 0; i < jComboBox.getItemCount(); i++) {
          final Object item = jComboBox.getItemAt(i);
          if (name.equals(item.toString())) {
            itemToSelect = Optional.of(item);
          }
        }
        if (itemToSelect.isPresent()) jComboBox.setSelectedItem(itemToSelect.get());
      }
    View Full Code Here

    Examples of com.google.common.base.Optional

          final NovaApi api = createMock(NovaApi.class);
          KeyPairApi keyApi = createMock(KeyPairApi.class);

          KeyPair pair = createMock(KeyPair.class);

          Optional optKeyApi = Optional.of(keyApi);
         
          expect(api.getKeyPairExtensionForZone("zone")).andReturn(optKeyApi).atLeastOnce();

          expect(keyApi.create("group-1")).andReturn(pair);
    View Full Code Here

    Examples of com.google.common.base.Optional

          final NovaApi api = createMock(NovaApi.class);
          KeyPairApi keyApi = createMock(KeyPairApi.class);

          KeyPair pair = createMock(KeyPair.class);

          Optional optKeyApi = Optional.of(keyApi);
         
          expect(api.getKeyPairExtensionForZone("zone")).andReturn(optKeyApi).atLeastOnce();

          expect(keyApi.create("group-1")).andReturn(pair);
    View Full Code Here

    Examples of com.google.gwt.i18n.client.Messages.Optional

        generateString(logger, template, params, seenFlags, generated);

        // Generate an error if any required parameter was not used somewhere.
        for (int i = 0; i < numParams; ++i) {
          if (!seenFlags[i]) {
            Optional optional = params[i].getAnnotation(Optional.class);
            if (optional == null) {
              throw error(logger, "Required argument " + i + " not present: "
                  + template);
            }
          }
    View Full Code Here

    Examples of com.google.gwt.i18n.client.Messages.Optional

        generateString(logger, template, params, seenFlags, generated);

        // Generate an error if any required parameter was not used somewhere.
        for (int i = 0; i < numParams; ++i) {
          if (!seenFlags[i]) {
            Optional optional = params[i].getAnnotation(Optional.class);
            if (optional == null) {
              throw error(logger, "Required argument " + i + " not present: "
                  + template);
            }
          }
    View Full Code Here

    Examples of com.google.gwt.i18n.client.Messages.Optional

        writer.println(";");

        // Generate an error if any required parameter was not used somewhere.
        for (int i = 0; i < numParams; ++i) {
          if (!seenFlags[i]) {
            Optional optional = params[i].getAnnotation(Optional.class);
            Select select = params[i].getAnnotation(Select.class);
            if (optional == null && select == null) {
              throw error(logger, "Required argument " + i + " not present: "
                  + template);
            }
    View Full Code Here

    Examples of com.google.gwt.i18n.client.Messages.Optional

              entry.addPluralText(pluralForms[i], pluralForms[i + 1]);
            }
          }
          for (JParameter param : method.getParameters()) {
            ArgumentInfo argInfo = entry.addArgument(param.getName());
            Optional optional = param.getAnnotation(Optional.class);
            if (optional != null) {
              argInfo.optional = true;
            }
            PluralCount pluralCount = param.getAnnotation(PluralCount.class);
            if (pluralCount != null) {
    View Full Code Here

    Examples of com.google.gwt.i18n.client.Messages.Optional

              entry.addPluralText(pluralForms[i], pluralForms[i + 1]);
            }
          }
          for (JParameter param : method.getParameters()) {
            ArgumentInfo argInfo = entry.addArgument(param.getName());
            Optional optional = param.getAnnotation(Optional.class);
            if (optional != null) {
              argInfo.optional = true;
            }
            PluralCount pluralCount = param.getAnnotation(PluralCount.class);
            if (pluralCount != null) {
    View Full Code Here

    Examples of com.google.gwt.i18n.client.Messages.Optional

        generateString(logger, template, params, seenFlags, generated);

        // Generate an error if any required parameter was not used somewhere.
        for (int i = 0; i < numParams; ++i) {
          if (!seenFlags[i]) {
            Optional optional = params[i].getAnnotation(Optional.class);
            if (optional == null) {
              throw error(logger, "Required argument " + i + " not present: "
                  + template);
            }
          }
    View Full Code Here

    Examples of com.google.gwt.i18n.client.Messages.Optional

        generateString(logger, template, params, seenFlags, generated);

        // Generate an error if any required parameter was not used somewhere.
        for (int i = 0; i < numParams; ++i) {
          if (!seenFlags[i]) {
            Optional optional = params[i].getAnnotation(Optional.class);
            if (optional == null) {
              throw error(logger, "Required argument " + params[i].getName()
                  + " not present: " + template);
            }
          }
    View Full Code Here
    TOP
    Copyright © 2018 www.massapi.com. All rights reserved.
    All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.