InvalidVisibility(final String i18nErrorMessage, final String param) { this.i18nErrorMessage = i18nErrorMessage; this.param = Option.some(param); }
public Builder parent(PageFixture parent) { this.parent = Option.some(parent); return this; }
/** * Preload the {@link com.atlassian.confluence.api.model.content.Content} object with the * given expansions. * @param expansions expansions. Use {@link com.atlassian.confluence.rest.api.model.ExpansionsParser} to create. */ public Builder preloadContentWith(Expansion... expansions) { this.expansions = Option.some(Arrays.asList(expansions)); return this; }
@Override public Option<URI> getProductHelpServerSpaceURI() { return Option.some(URI.create("jcore-docs-" + info.getDocVersion())); }
@Override @Nonnull public Option<String> getHelpSpace(@Nonnull final ApplicationKey applicationKey) { return Option.some(jiraProductInformation.getSetupHelpApplicationHelpSpace()); } }
protected static Option<JiraWorkflow> getWorkflow(Map<String, Object> context) { final Object maybeWorkflow = context.get(WORKFLOW_KEY); return maybeWorkflow instanceof JiraWorkflow ? Option.some((JiraWorkflow) maybeWorkflow) : Option.<JiraWorkflow>none(); } }
@Override public Option<E> apply(L value) { return Option.some(createCacheableEntity(key, value)); } });
@Override protected Option<String> doGenerateMessage(final I18nHelper localisedMessages) { return Option.some(localisedMessages.getText("attachfile.error.save.to.store", this.getMessage())); }
@Override public Option<Version> getVersionToMergeTo() { return isMerge() ? some(affectsSwapVersion) : Option.<Version>none(); }
@Override public PortletConfiguration addGadget(final Long portalPageId, final Integer column, final Integer row, final URI gadgetXml, final Color color, final Map<String, String> userPreferences) { return addDashBoardItem(portalPageId, column, row, Option.some(gadgetXml), color, userPreferences, Option.<ModuleCompleteKey>none()); }
@Override public Option<String> apply(final ResourceDescriptor resourceDescriptor) { Map<String, Object> contextMap = getContextProvider().getContextMap(context); return Option.some(getHtml(resourceDescriptor, contextMap)); } }
@Override protected Option<String> doGenerateMessage(final I18nHelper localisedMessages) { return Option.some(localisedMessages.getText("attachfile.error.temp.writeerror", this.getMessage())); } }
private Option<Notification> createCustomFieldNotification(final NotificationType notificationType, final Long schemeEntityId, final String customFieldId) { final CustomField customField = customFieldManager.getCustomFieldObject(customFieldId); return Option.<Notification>some(new CustomFieldValueNotification(schemeEntityId, notificationType, customField, customFieldId)); }
public PortletConfiguration addGadget(final Long pageId, final Long portletConfigurationId, final Integer column, final Integer row, final URI gadgetXml, final Color color, final Map<String, String> userPreferences) { return addDashboardItem(pageId, portletConfigurationId, column, row, Option.some(gadgetXml), color, userPreferences, Option.<ModuleCompleteKey>none()); }
private Option<String> getBaseUrlFromRequest() { final HttpServletRequest request = ExecutingHttpRequest.get(); if (request != null) { return Option.some(JiraUrl.constructBaseUrl(request)); } return Option.none(); }
@Override public Option<ProjectPermission> withKey(ProjectPermissionKey key) { for (ProjectPermission permission : all()) { if (permission.getKey().equals(key.permissionKey())) { return some(permission); } } return none(); }
private Option<String> getErrorOnAnonymousUser() { if (isAnonymous(jiraServiceContext.getLoggedInApplicationUser())) { return Option.some(getText(i18nPrefix + ".service.error.visibility.anonymous")); } else { return Option.none(); } } });
private Option<ProjectType> findProjectTypeByKey(Iterable<ProjectType> types, ProjectTypeKey key) { for (ProjectType projectType : types) { if (key.equals(projectType.getKey())) { return some(projectType); } } return none(); }
@Override public Option<RecordRequest> onWorkflowUpdatedEvent(WorkflowUpdatedEvent event) { if (event.getWorkflow().isDraftWorkflow()) { return Option.none(); //for now we ignore any changes to draft workflows } else { return Option.some(workflowUpdated(event.getOriginalWorkflow(), event.getWorkflow())); } }
public static NotificationType fromModuleDescriptor(HipChatNotificationDescriptor moduleDescriptor, I18nResolver i18nResolver, HipChatNotification notification) { return new NotificationType( moduleDescriptor.getValue(), i18nResolver.getText(moduleDescriptor.getI18nNameKey()), moduleDescriptor.getContext(), moduleDescriptor.getCategory(), moduleDescriptor.getWeight(), moduleDescriptor.isActiveByDefault(), Option.some(notification)); } }