com.tangosol.internal.management.EntityMBeanResponse Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of coherence Show documentation
Show all versions of coherence Show documentation
Oracle Coherence Community Edition
/*
* Copyright (c) 2000, 2022, Oracle and/or its affiliates.
*
* Licensed under the Universal Permissive License v 1.0 as shown at
* http://oss.oracle.com/licenses/upl.
*/
package com.tangosol.internal.management;
import com.tangosol.internal.http.HttpRequest;
import com.tangosol.util.Base;
import com.tangosol.util.Filter;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
/**
* The MBeanResponse used for sending entities i.e. actual MBean
* object/collection itself.
*
* @author sr 2017.08.21
* @since 12.2.1.4.0
*/
public class EntityMBeanResponse
extends MBeanResponse
{
// ----- constructors -----------------------------------------------------------------
/**
* Default Constructor.
*/
public EntityMBeanResponse()
{
}
/**
* Construct an EntityMBeanResponse instance.
*
* @param request the request context
* @param filterLinks the links filter
*/
public EntityMBeanResponse(HttpRequest request, Filter filterLinks)
{
super(request, filterLinks);
}
// ----- EntityMBeanResponse methods ------------------------------------------------------
/**
* Return {@code true} if this response has an entity.
*
* @return {@code true} if this response has an entity
*/
public boolean hasEntity()
{
return !m_listEntities.isEmpty() || !m_mapEntity.isEmpty();
}
/**
* Returns {@code true} if this response has no entity.
*
* @return {@code true} if this response has no entity
*/
public boolean isEmpty()
{
return !hasEntity();
}
/**
* Return the entity object,
*
* @return the entity object
*/
public Map getEntity()
{
return m_mapEntity;
}
/**
* Update the entity object.
*
* @param entity the entity object
*/
public void setEntity(Map entity)
{
m_mapEntity = entity;
}
/**
* Return the entities object,
*
* @return the entities object
*/
public List