congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
CustomFieldParams.getFirstValueForKey
Code IndexAdd Tabnine to your IDE (free)

How to use
getFirstValueForKey
method
in
com.atlassian.jira.issue.customfields.view.CustomFieldParams

Best Java code snippets using com.atlassian.jira.issue.customfields.view.CustomFieldParams.getFirstValueForKey (Showing top 6 results out of 315)

origin: com.atlassian.jira/jira-api

public T getValueFromCustomFieldParams(CustomFieldParams parameters) throws FieldValidationException
{
  Object o = parameters.getFirstValueForKey(null);
  // This method mandates that it cannot be a collection object.  To provide backwards compatability I have assumed T == S.
  // If not it will break at run time. And hopefully plugin developers will see it.  I'm assuming the method doesn't get used though, cause surely it would have broken before now
  // ParticipantsCustomField is an example of one which is actually a collection.
  return (T) getSingularObjectFromString((String) o);
}
origin: com.atlassian.jira/jira-core

/**
 * Retrieve the first value of the given param key and convert it to a Long object if it's a valid long in String format.
 * @return the parsed Long object, or null if invalid
 */
private Long getLongFromParamsByKey(final CustomFieldParams relevantParams, final String key)
{
  final Object obj = relevantParams.getFirstValueForKey(key);
  if (obj != null && obj instanceof String)
  {
    final long parsedLong = NumberUtils.toLong(obj.toString(), -1);
    if (parsedLong != -1)
    {
      return parsedLong;
    }
  }
  return null;
}
origin: com.atlassian.jira/jira-api

if (customFieldParams.containsKey(NumberRangeSearcher.LESS_THAN_PARAM))
  String s = (String) customFieldParams.getFirstValueForKey(NumberRangeSearcher.LESS_THAN_PARAM);
  if (s != null)
  String s = (String) customFieldParams.getFirstValueForKey(NumberRangeSearcher.GREATER_THAN_PARAM);
  if (s != null)
origin: com.atlassian.jira/jira-core

private CustomFieldParams handleInvalidFunctionOperand(final TerminalClause clause)
{
  CustomFieldParams customFieldParams = null;
  FunctionOperand fop = (FunctionOperand)clause.getOperand();
  if (fop.getName().equals(CascadeOptionFunction.FUNCTION_CASCADE_OPTION))
  {
    if (fop.getArgs().size() == 2)
    {
      customFieldParams = new CustomFieldParamsImpl(customField);
      customFieldParams.put(CascadingSelectCFType.PARENT_KEY, Collections.singleton(fop.getArgs().get(0)));
      customFieldParams.put(CascadingSelectCFType.CHILD_KEY, Collections.singleton(fop.getArgs().get(1)));
    }
    else if (fop.getArgs().size() == 1)
    {
      customFieldParams = new CustomFieldParamsImpl(customField);
      customFieldParams.put(CascadingSelectCFType.PARENT_KEY, Collections.singleton(fop.getArgs().get(0)));
    }
    if (customFieldParams != null) {
      String parentValue = (String) customFieldParams.getFirstValueForKey(CascadingSelectCFType.PARENT_KEY);
      final List<Option> options = jqlSelectOptionsUtil.getOptions(customField, new QueryLiteral(clause.getOperand(), parentValue), true);
      if (options.isEmpty() || options.get(0) == null)
      {
        return null;
      }
    }
  }
  return customFieldParams;
}
origin: com.atlassian.jira/jira-api

@Override
public void validateParams(final ApplicationUser user, final SearchContext searchContext, final FieldValuesHolder fieldValuesHolder, final I18nHelper i18nHelper, final ErrorCollection errors)
{
  CustomFieldParams params = (CustomFieldParams) fieldValuesHolder.get(getCustomField().getId());
  if (params != null)
  {
    String[] rangeParams = { NumberRangeSearcher.LESS_THAN_PARAM, NumberRangeSearcher.GREATER_THAN_PARAM};
    for (String rangeParam : rangeParams)
    {
      final String numberString = (String) params.getFirstValueForKey(rangeParam);
      if (StringUtils.isNotEmpty(numberString))
      {
        try
        {
          doubleConverter.getDouble(numberString);
        }
        catch (FieldValidationException e)
        {
          errors.addError(getCustomField().getId(), e.getMessage());
        }
      }
    }
  }
}
origin: com.atlassian.jira/jira-core

final Object requireProjectIds = relevantParams.getFirstValueForKey(CustomFieldUtils.getParamKeyRequireProjectIds());
if (requireProjectIds == null || !Boolean.parseBoolean(requireProjectIds.toString()))
com.atlassian.jira.issue.customfields.viewCustomFieldParamsgetFirstValueForKey

Popular methods of CustomFieldParams

  • getValuesForKey
  • isEmpty
  • containsKey
  • getCustomField
  • getFirstValueForNullKey
  • getKeysAndValues
  • getValuesForNullKey
  • getAllValues
  • put
  • setCustomField
  • transformObjectsToStrings
  • transformObjectsToStrings

Popular in Java

  • Making http post requests using okhttp
  • findViewById (Activity)
  • setContentView (Activity)
  • requestLocationUpdates (LocationManager)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now