com.liferay.social.kernel.model.impl.SocialRequestInterpreterImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of com.liferay.portal.kernel Show documentation
Show all versions of com.liferay.portal.kernel Show documentation
Contains interfaces for the portal services. Interfaces are only loaded by the global class loader and are shared by all plugins.
/**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
package com.liferay.social.kernel.model.impl;
import com.liferay.portal.kernel.theme.ThemeDisplay;
import com.liferay.social.kernel.model.SocialRequest;
import com.liferay.social.kernel.model.SocialRequestFeedEntry;
import com.liferay.social.kernel.model.SocialRequestInterpreter;
import java.util.HashSet;
import java.util.Set;
/**
* @author Brian Wing Shun Chan
*/
public class SocialRequestInterpreterImpl implements SocialRequestInterpreter {
public SocialRequestInterpreterImpl(
String portletId, SocialRequestInterpreter requestInterpreter) {
_portletId = portletId;
_requestInterpreter = requestInterpreter;
String[] classNames = _requestInterpreter.getClassNames();
for (String className : classNames) {
_classNames.add(className);
}
}
@Override
public String[] getClassNames() {
return _requestInterpreter.getClassNames();
}
public String getPortletId() {
return _portletId;
}
public boolean hasClassName(String className) {
if (_classNames.contains(className)) {
return true;
}
else {
return false;
}
}
@Override
public SocialRequestFeedEntry interpret(
SocialRequest request, ThemeDisplay themeDisplay) {
return _requestInterpreter.interpret(request, themeDisplay);
}
@Override
public boolean processConfirmation(
SocialRequest request, ThemeDisplay themeDisplay) {
return _requestInterpreter.processConfirmation(request, themeDisplay);
}
@Override
public boolean processRejection(
SocialRequest request, ThemeDisplay themeDisplay) {
return _requestInterpreter.processRejection(request, themeDisplay);
}
private final Set _classNames = new HashSet<>();
private final String _portletId;
private final SocialRequestInterpreter _requestInterpreter;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy