Constructs a {@link ICallback.CallbackOption} with predicate {@link ICallback.ICallbackPredicate#alwaysTrue()} and the specified
{@link Priority}.

@param <P> the generic type
@param priority the priority
@return the callback option
160804
public static <P extends ICallbackPredicate> CallbackOption<P> of(Priority priority)
		{
			return new CallbackOption<>(null, priority);
		}
21499
def gui_do_priority(self, priority, method, *args, **kwdargs):
        
        future = Future.Future(priority=priority)
        future.freeze(method, *args, **kwdargs)
        self.priority_gui_queue.put(future)

        my_id = thread.get_ident()
        if my_id != self.gui_thread_id:
            return future
1076580
public void log(final Priority priority, final Object message, final Throwable t) {
		provider.log(STACKTRACE_DEPTH, null, translatePriority(priority), t, message == t ? null : message, (Object[]) null);
	}
414928
public void setPriority(FaxJobPriority priority)
    {
        try
        {
            if(priority==FaxJobPriority.HIGH_PRIORITY)
            {
                this.JOB.setPriority(Job.PRIORITY_HIGH);
            }
            else
            {
                this.JOB.setPriority(Job.PRIORITY_NORMAL);
            }
        }
        catch(Exception exception)
        {
            throw new FaxException("Error while setting job priority.",exception);
        }
    }
1240203
public void setPriority(Integer priority) {        
        if (priority == null) {
            _properties.remove(AMQP_PROP_PRIORITY);
            return;
        }
        
        int priorityValue = priority.intValue();
        if ((priorityValue < 0) || (priorityValue > 9)) {
            String s = "AMQP 0-9-1 spec mandates 'priority' value to be between 0 and 9";
            throw new IllegalStateException(s);
        }
        
        _properties.put(AMQP_PROP_PRIORITY, priority);
    }
546656
public <T extends ImmutableTerm> ImmutableSubstitution<T> prioritizeRenaming(
            ImmutableSubstitution<T> substitution, ImmutableSet<Variable> priorityVariables) {

        ImmutableMultimap<Variable, Variable> renamingMultimap = substitution.getImmutableMap().entrySet().stream()
                .filter(e -> priorityVariables.contains(e.getKey())
                        && (e.getValue() instanceof Variable)
                        && (!priorityVariables.contains(e.getValue())))
                .collect(ImmutableCollectors.toMultimap(
                        e -> (Variable) e.getValue(),
                        Map.Entry::getKey));

        if (renamingMultimap.isEmpty())
            return substitution;

        ImmutableMap<Variable, Variable> renamingMap = renamingMultimap.asMap().entrySet().stream()
                .collect(ImmutableCollectors.toMap(
                        Map.Entry::getKey,
                        e -> e.getValue().iterator().next()));
        InjectiveVar2VarSubstitution renamingSubstitution = substitutionFactory.getInjectiveVar2VarSubstitution(renamingMap);

        // TODO: refactor
        return (ImmutableSubstitution<T>) renamingSubstitution.composeWith(substitution);
    }
105076
@Override
    public RequestPromise<T> always(io.reinert.gdeferred.AlwaysCallback<T, Throwable> callback) {
        super.always(callback);
        return this;
    }
1189441
public <T> CallOptions withOption(Key<T> key, T value) {
    Preconditions.checkNotNull(key, "key");
    Preconditions.checkNotNull(value, "value");

    CallOptions newOptions = new CallOptions(this);
    int existingIdx = -1;
    for (int i = 0; i < customOptions.length; i++) {
      if (key.equals(customOptions[i][0])) {
        existingIdx = i;
        break;
      }
    }

    newOptions.customOptions = new Object[customOptions.length + (existingIdx == -1 ? 1 : 0)][2];
    System.arraycopy(customOptions, 0, newOptions.customOptions, 0, customOptions.length);

    if (existingIdx == -1) {
      // Add a new option
      newOptions.customOptions[customOptions.length] = new Object[] {key, value};
    } else {
      // Replace an existing option
      newOptions.customOptions[existingIdx] = new Object[] {key, value};
    }

    return newOptions;
  }
82076
public <T> GrpcServerBuilder withChildOption(ChannelOption<T> option, T value) {
    mNettyServerBuilder = mNettyServerBuilder.withChildOption(option, value);
    return this;
  }
1285106
@Indexable(type = IndexableType.REINDEX)
	@Override
	public CPOption addCPOption(CPOption cpOption) {
		cpOption.setNew(true);

		return cpOptionPersistence.update(cpOption);
	}
277011
public <T> NettyChannelBuilder withOption(ChannelOption<T> option, T value) {
    channelOptions.put(option, value);
    return this;
  }
652716
public boolean changePriority(E key, double priority) {
    Entry<E> entry = getEntry(key);
    if (entry == null) {
      entry = makeEntry(key);
    }
    if (compare(priority, entry.priority) == 0) {
      return false;
    }
    entry.priority = priority;
    heapify(entry);
    return true;
  }
1255611
public PriorityConverter getConverter(Type type) {
        PriorityConverter converter = converters.get(type);
        return converter;
    }
250170
public static Priority getInstance(int priority)
   {
      Priority result;

      if (priority >= LOWEST && priority <= DO_NOT_LEVEL && (priority % 100 == 0))
      {
         result = VALUE[(priority / 100) - 1];
      }
      else
      {
         result = new Priority(priority);
      }

      return (result);
   }
19027
public function setPriority($priority)
    {
        if (!OptionsPriorities::isValid($priority)) {
            throw new InvalidOptionsException('priority is not valid, please refer to the documentation or use the constants of the class "OptionsPriorities"');
        }
        $this->priority = $priority;

        return $this;
    }
1225577
public void setMinPriority(String minPriority) {
        this.minPriority = minPriority;

        Integer value = priorityNameToValueMap.get(minPriority);
        if (value == null) {
            value = priorityNameToValueMap.get(DEFAULT_PRIORITY);
            if (value == null) {
                throw new IllegalStateException();
            }
        }

        this.minPriorityAsInt = value.intValue();

    }
717595
public boolean isEnabledFor( final Priority priority )
    {
        if ( priority == null )
        {
            return false;
        }

        switch ( priority.level )
        {
            case Level.FATAL_INT:
                return m_delegate.isFatalEnabled();
            case Level.ERROR_INT:
                return m_delegate.isErrorEnabled();
            case Level.WARN_INT:
                return m_delegate.isWarnEnabled();
            case Level.INFO_INT:
                return m_delegate.isInfoEnabled();
            case Level.DEBUG_INT:
                return m_delegate.isDebugEnabled();
            case Level.TRACE_INT:
            case Level.ALL_INT:
                return m_delegate.isTraceEnabled();
            default:
                return false;
        }
    }