private int computeConstructorParameterOrder() {
    boolean enabledAsAllParameters =
        style().allParameters();

    boolean enabledAsAllMandatoryParameters =
        style().allMandatoryParameters() && isMandatory();

    Optional<ParameterMirror> parameterAnnotation = ParameterMirror.find(element);
    if (parameterAnnotation.isPresent()) {
      if (!parameterAnnotation.get().value()) {
        // Cancelled out parameter identified, can return immediately
        return CONSTRUCTOR_NOT_A_PARAMETER;
      }

      int order = parameterAnnotation.get().order();
      boolean orderActuallySpecified = order >= CONSTRUCTOR_PARAMETER_DEFAULT_ORDER;
      // when order is unspecified it would be -1, but we should not treat is as
      // CONSTRUCTOR_NOT_A_PARAMETER, so we assign CONSTRUCTOR_PARAMETER_DEFAULT_ORDER
      // in this case
      if (orderActuallySpecified) {
        return order;
      }
      // We issue this warning only when order is not specified explicitly
      // and it is not a cancelling-out annotation thus the annoation
      // is truly superfluos when allParameters enabled
      if (enabledAsAllParameters) {
        report().annotationNamed(ParameterMirror.simpleName())
            .warning(About.INCOMPAT,
                "Annotation @Value.Parameter is superfluous when Style(allParameters = true)");
      }
      if (enabledAsAllMandatoryParameters) {
        report().annotationNamed(ParameterMirror.simpleName())
            .warning(About.INCOMPAT,
                "Annotation @Value.Parameter is superfluous when Style(allMandatoryParameters = true)"
                    + " and it is mandatory");
      }
      return CONSTRUCTOR_PARAMETER_DEFAULT_ORDER;
    }
    if (enabledAsAllParameters || enabledAsAllMandatoryParameters) {
      return CONSTRUCTOR_PARAMETER_DEFAULT_ORDER;
    }
    if (isAnnotationValueAttribute() && thereAreNoOtherMandatoryAttributes()) {
      // for annotation type, if annotation only contain single mandatory
      // attribute which is called 'value' it will be automatically turned
      // into constructor parameter
      return CONSTRUCTOR_PARAMETER_DEFAULT_ORDER;
    }
    return CONSTRUCTOR_NOT_A_PARAMETER;
  }
Suitable for JavaDocs, intemediate name mangling and for Guava intergration.
@return the raw collection type
value-processor/src/org/immutables/value/processor/meta/ValueAttribute.java