Codota Logo
Optional.absent
Code IndexAdd Codota to your IDE (free)

How to use
absent
method
in
japicmp.util.Optional

Best Java code snippets using japicmp.util.Optional.absent (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
SimpleDateFormat s =
  • Codota IconString pattern;new SimpleDateFormat(pattern)
  • Codota IconString template;Locale locale;new SimpleDateFormat(template, locale)
  • Codota Iconnew SimpleDateFormat()
  • Smart code suggestions by Codota
}
origin: com.github.siom79.japicmp/japicmp

public static Optional<SemanticVersion> getSemanticVersion(String version)  {
  Optional<SemanticVersion> semanticVersion = Optional.absent();
  Matcher matcher = VERSION_PATTERN_THREE_DIGITS.matcher(version);
  if (matcher.matches()) {
    if (matcher.groupCount() >= 3) {
      try {
        int major = Integer.parseInt(matcher.group(1));
        int minor = Integer.parseInt(matcher.group(2));
        int patch = Integer.parseInt(matcher.group(3));
        semanticVersion = Optional.of(new SemanticVersion(major, minor, patch));
      } catch (NumberFormatException e) {
        LOGGER.log(Level.FINE, String.format("Could not convert version into three digits for file name: %s", version), e);
      }
    } else {
      LOGGER.log(Level.FINE, String.format("Could not find three digits separated by a point in file name: %s", version));
    }
  } else {
    LOGGER.log(Level.FINE, String.format("Could not find three digits separated by a point in file name: %s", version));
  }
  return semanticVersion;
}
origin: siom79/japicmp

public static Optional<SemanticVersion> getSemanticVersion(String version)  {
  Optional<SemanticVersion> semanticVersion = Optional.absent();
  Matcher matcher = VERSION_PATTERN_THREE_DIGITS.matcher(version);
  if (matcher.matches()) {
    if (matcher.groupCount() >= 3) {
      try {
        int major = Integer.parseInt(matcher.group(1));
        int minor = Integer.parseInt(matcher.group(2));
        int patch = Integer.parseInt(matcher.group(3));
        semanticVersion = Optional.of(new SemanticVersion(major, minor, patch));
      } catch (NumberFormatException e) {
        LOGGER.log(Level.FINE, String.format("Could not convert version into three digits for file name: %s", version), e);
      }
    } else {
      LOGGER.log(Level.FINE, String.format("Could not find three digits separated by a point in file name: %s", version));
    }
  } else {
    LOGGER.log(Level.FINE, String.format("Could not find three digits separated by a point in file name: %s", version));
  }
  return semanticVersion;
}
origin: siom79/japicmp

@XmlTransient
public Optional<String> getOldSuperclassName() {
  return oldSuperclassOptional.isPresent() ? Optional.of(oldSuperclassOptional.get().getName()) : Optional.<String>absent();
}
origin: siom79/japicmp

@XmlTransient
public Optional<String> getNewSuperclassName() {
  return newSuperclassOptional.isPresent() ? Optional.of(newSuperclassOptional.get().getName()) : Optional.<String>absent();
}
origin: com.github.siom79.japicmp/japicmp

@XmlTransient
public Optional<String> getNewSuperclassName() {
  return newSuperclassOptional.isPresent() ? Optional.of(newSuperclassOptional.get().getName()) : Optional.<String>absent();
}
origin: com.github.siom79.japicmp/japicmp

@XmlTransient
public Optional<String> getOldSuperclassName() {
  return oldSuperclassOptional.isPresent() ? Optional.of(oldSuperclassOptional.get().getName()) : Optional.<String>absent();
}
origin: siom79/japicmp

private Map<String, Optional<MemberValue>> buildMemberValueMap(Annotation annotation) {
  Map<String, Optional<MemberValue>> map = new HashMap<>();
  @SuppressWarnings("unchecked")
  Set<String> memberNames = annotation.getMemberNames();
  if (memberNames != null) {
    for (String memberName : memberNames) {
      MemberValue memberValue = annotation.getMemberValue(memberName);
      if (memberValue == null) {
        map.put(memberName, Optional.<MemberValue>absent());
      } else {
        map.put(memberName, Optional.of(memberValue));
      }
    }
  }
  return map;
}
origin: com.github.siom79.japicmp/japicmp

private Map<String, Optional<MemberValue>> buildMemberValueMap(Annotation annotation) {
  Map<String, Optional<MemberValue>> map = new HashMap<>();
  @SuppressWarnings("unchecked")
  Set<String> memberNames = annotation.getMemberNames();
  if (memberNames != null) {
    for (String memberName : memberNames) {
      MemberValue memberValue = annotation.getMemberValue(memberName);
      if (memberValue == null) {
        map.put(memberName, Optional.<MemberValue>absent());
      } else {
        map.put(memberName, Optional.of(memberValue));
      }
    }
  }
  return map;
}
origin: siom79/japicmp

private Optional<JApiAnnotation> getTransientAnnotationOfField(JApiField field) {
  Optional<JApiAnnotation> returnValue = Optional.absent();
  for (JApiAnnotation annotation : field.getAnnotations()) {
    if (JpaAnalyzer.JPA_ANNOTATION_TRANSIENT.equals(annotation.getFullyQualifiedName())) {
      returnValue = Optional.of(annotation);
      break;
    }
  }
  return returnValue;
}
origin: com.github.siom79.japicmp/japicmp

private Optional<JApiAnnotation> getTransientAnnotationOfField(JApiField field) {
  Optional<JApiAnnotation> returnValue = Optional.absent();
  for (JApiAnnotation annotation : field.getAnnotations()) {
    if (JpaAnalyzer.JPA_ANNOTATION_TRANSIENT.equals(annotation.getFullyQualifiedName())) {
      returnValue = Optional.of(annotation);
      break;
    }
  }
  return returnValue;
}
origin: siom79/japicmp

private JApiCmpMojo getMojo() {
  if (mojo != null) {
    return mojo;
  }
  mojo = new JApiCmpMojo();
  mavenParameters = new MavenParameters(artifactRepositories, artifactFactory, localRepository, artifactResolver, mavenProject, mojoExecution, versionRangeWithProjectVersion, metadataSource);
  pluginParameters = new PluginParameters(skip, newVersion, oldVersion, parameter, dependencies, Optional.<File>absent(), Optional.of(outputDirectory), false, oldVersions, newVersions, oldClassPathDependencies, newClassPathDependencies);
  return mojo;
}
origin: siom79/japicmp

public void execute() throws MojoExecutionException, MojoFailureException {
  MavenParameters mavenParameters = new MavenParameters(artifactRepositories, artifactFactory, localRepository, artifactResolver, mavenProject, mojoExecution, versionRangeWithProjectVersion, metadataSource);
  PluginParameters pluginParameters = new PluginParameters(skip, newVersion, oldVersion, parameter, dependencies, Optional.of(projectBuildDir), Optional.<String>absent(), true, oldVersions, newVersions, oldClassPathDependencies, newClassPathDependencies);
  executeWithParameters(pluginParameters, mavenParameters);
}
origin: siom79/japicmp

private Optional<JApiAnnotation> getTransientAnnotationOfProperty(JApiField field) {
  Optional<JApiAnnotation> returnValue = Optional.absent();
  Optional<JApiMethod> propertyMethodOptional = getPropertyMethod(field);
  if (propertyMethodOptional.isPresent()) {
    JApiMethod propertyMethod = propertyMethodOptional.get();
    for (JApiAnnotation annotation : propertyMethod.getAnnotations()) {
      if (JpaAnalyzer.JPA_ANNOTATION_TRANSIENT.equals(annotation.getFullyQualifiedName())) {
        returnValue = Optional.of(annotation);
        break;
      }
    }
  }
  return returnValue;
}
origin: com.github.siom79.japicmp/japicmp

private Optional<JApiAnnotation> getTransientAnnotationOfProperty(JApiField field) {
  Optional<JApiAnnotation> returnValue = Optional.absent();
  Optional<JApiMethod> propertyMethodOptional = getPropertyMethod(field);
  if (propertyMethodOptional.isPresent()) {
    JApiMethod propertyMethod = propertyMethodOptional.get();
    for (JApiAnnotation annotation : propertyMethod.getAnnotations()) {
      if (JpaAnalyzer.JPA_ANNOTATION_TRANSIENT.equals(annotation.getFullyQualifiedName())) {
        returnValue = Optional.of(annotation);
        break;
      }
    }
  }
  return returnValue;
}
origin: siom79/japicmp

private Optional<Integer> getLineNumber(Optional<? extends CtBehavior> methodOptional) {
  Optional<Integer> lineNumberOptional = Optional.absent();
  if (methodOptional.isPresent()) {
    CtBehavior ctMethod = methodOptional.get();
    int lineNumber = ctMethod.getMethodInfo().getLineNumber(0);
    if (lineNumber >= 0) {
      lineNumberOptional = Optional.of(lineNumber);
    }
  }
  return lineNumberOptional;
}
origin: com.github.siom79.japicmp/japicmp

private Optional<Integer> getLineNumber(Optional<? extends CtBehavior> methodOptional) {
  Optional<Integer> lineNumberOptional = Optional.absent();
  if (methodOptional.isPresent()) {
    CtBehavior ctMethod = methodOptional.get();
    int lineNumber = ctMethod.getMethodInfo().getLineNumber(0);
    if (lineNumber >= 0) {
      lineNumberOptional = Optional.of(lineNumber);
    }
  }
  return lineNumberOptional;
}
origin: siom79/japicmp

private JApiReturnType computeReturnTypeChanges(Optional<CtMethod> oldMethodOptional, Optional<CtMethod> newMethodOptional) {
  JApiReturnType jApiReturnType = new JApiReturnType(JApiChangeStatus.UNCHANGED, Optional.<String>absent(), Optional.<String>absent());
  if (oldMethodOptional.isPresent() && newMethodOptional.isPresent()) {
    String oldReturnType = computeReturnType(oldMethodOptional.get());
    String newReturnType = computeReturnType(newMethodOptional.get());
    JApiChangeStatus changeStatusReturnType = JApiChangeStatus.UNCHANGED;
    if (!oldReturnType.equals(newReturnType)) {
      changeStatusReturnType = JApiChangeStatus.MODIFIED;
    }
    jApiReturnType = new JApiReturnType(changeStatusReturnType, Optional.of(oldReturnType), Optional.of(newReturnType));
  } else {
    if (oldMethodOptional.isPresent()) {
      String oldReturnType = computeReturnType(oldMethodOptional.get());
      jApiReturnType = new JApiReturnType(JApiChangeStatus.REMOVED, Optional.of(oldReturnType), Optional.<String>absent());
    }
    if (newMethodOptional.isPresent()) {
      String newReturnType = computeReturnType(newMethodOptional.get());
      jApiReturnType = new JApiReturnType(JApiChangeStatus.NEW, Optional.<String>absent(), Optional.of(newReturnType));
    }
  }
  return jApiReturnType;
}
origin: com.github.siom79.japicmp/japicmp

private JApiReturnType computeReturnTypeChanges(Optional<CtMethod> oldMethodOptional, Optional<CtMethod> newMethodOptional) {
  JApiReturnType jApiReturnType = new JApiReturnType(JApiChangeStatus.UNCHANGED, Optional.<String>absent(), Optional.<String>absent());
  if (oldMethodOptional.isPresent() && newMethodOptional.isPresent()) {
    String oldReturnType = computeReturnType(oldMethodOptional.get());
    String newReturnType = computeReturnType(newMethodOptional.get());
    JApiChangeStatus changeStatusReturnType = JApiChangeStatus.UNCHANGED;
    if (!oldReturnType.equals(newReturnType)) {
      changeStatusReturnType = JApiChangeStatus.MODIFIED;
    }
    jApiReturnType = new JApiReturnType(changeStatusReturnType, Optional.of(oldReturnType), Optional.of(newReturnType));
  } else {
    if (oldMethodOptional.isPresent()) {
      String oldReturnType = computeReturnType(oldMethodOptional.get());
      jApiReturnType = new JApiReturnType(JApiChangeStatus.REMOVED, Optional.of(oldReturnType), Optional.<String>absent());
    }
    if (newMethodOptional.isPresent()) {
      String newReturnType = computeReturnType(newMethodOptional.get());
      jApiReturnType = new JApiReturnType(JApiChangeStatus.NEW, Optional.<String>absent(), Optional.of(newReturnType));
    }
  }
  return jApiReturnType;
}
origin: siom79/japicmp

private Optional<CtClass> getSuperclass(CtClass ctClass) {
  try {
    CtClass superClass = ctClass.getSuperclass();
    return Optional.fromNullable(superClass);
  } catch (NotFoundException e) {
    if (options.getIgnoreMissingClasses().ignoreClass(e.getMessage())) {
      return Optional.absent();
    } else {
      throw JApiCmpException.forClassLoading(e, e.getMessage(), jarArchiveComparator);
    }
  }
}
origin: com.github.siom79.japicmp/japicmp

private Optional<CtClass> getSuperclass(CtClass ctClass) {
  try {
    CtClass superClass = ctClass.getSuperclass();
    return Optional.fromNullable(superClass);
  } catch (NotFoundException e) {
    if (options.getIgnoreMissingClasses().ignoreClass(e.getMessage())) {
      return Optional.absent();
    } else {
      throw JApiCmpException.forClassLoading(e, e.getMessage(), jarArchiveComparator);
    }
  }
}
japicmp.utilOptionalabsent

Popular methods of Optional

  • fromNullable
  • isPresent
  • get
  • of
  • hashCode
  • or

Popular in Java

  • Creating JSON documents from java classes using gson
  • scheduleAtFixedRate (Timer)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • putExtra (Intent)
  • Menu (java.awt)
  • InputStreamReader (java.io)
    An InputStreamReader is a bridge from byte streams to character streams: It reads bytes and decodes
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Dictionary (java.util)
    The Dictionary class is the abstract parent of any class, such as Hashtable, which maps keys to valu
  • JList (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now