-
-
Save odaBio/5087321aec7016564383b0c44ee8ab1e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.biomerieux.adobe.core.models.impl; | |
| import org.apache.sling.api.SlingHttpServletRequest; | |
| import org.apache.sling.api.resource.Resource; | |
| import org.apache.sling.api.resource.ValueMap; | |
| import com.biomerieux.adobe.core.models.OptionItem; | |
| public class OptionItemImpl implements OptionItem { | |
| private static final String PN_TEXT = "text"; | |
| private static final String PN_VALUE = "value"; | |
| private static final String PN_URL = "url"; | |
| private static final String PN_TITLE = "title"; | |
| private SlingHttpServletRequest request; | |
| private Resource options; | |
| private ValueMap properties; | |
| public OptionItemImpl(SlingHttpServletRequest request, Resource options, Resource option) { | |
| this.request = request; | |
| this.options = options; | |
| this.properties = option.getValueMap(); | |
| } | |
| @Override | |
| public String getText() { | |
| return properties.get(PN_TEXT, String.class); | |
| } | |
| @Override | |
| public String getValue() { | |
| return properties.get(PN_VALUE, String.class); | |
| } | |
| @Override | |
| public String getTitle() { | |
| return properties.get(PN_TITLE, String.class); | |
| } | |
| @Override | |
| public String getUrl() { | |
| return properties.get(PN_URL, String.class); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment