Forge - Shell API 1.2.0.Final

org.jboss.forge.resources
Class EntryResource<K,V>

java.lang.Object
  extended by org.jboss.forge.resources.AbstractResource<T>
      extended by org.jboss.forge.resources.VirtualResource<Map.Entry<K,V>>
          extended by org.jboss.forge.resources.EntryResource<K,V>
All Implemented Interfaces:
Resource<Map.Entry<K,V>>

public class EntryResource<K,V>
extends VirtualResource<Map.Entry<K,V>>

Represents a Key-value entry

Author:
George Gastaldi

Field Summary
 
Fields inherited from class org.jboss.forge.resources.AbstractResource
flags, parent, resourceFactory
 
Constructor Summary
EntryResource(Resource<?> parent, K key, V value)
           
 
Method Summary
 boolean delete()
          Delete this resource, return true if successful, false if not.
 boolean delete(boolean recursive)
          Delete this resource, return true if successful, false if not.
protected  List<Resource<?>> doListResources()
          Strategy method for returning child resources.
 K getKey()
           
 String getName()
          Return the common name of the resource.
 Map.Entry<K,V> getUnderlyingResourceObject()
          Get the underlying object represented by this Resource
 V getValue()
           
 
Methods inherited from class org.jboss.forge.resources.VirtualResource
createFrom, exists, getChild, getResourceInputStream
 
Methods inherited from class org.jboss.forge.resources.AbstractResource
equals, getFlags, getFullyQualifiedName, getParent, getResourceFactory, hashCode, isFlagSet, listResources, listResources, reify, setFlag, unsetFlag
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntryResource

public EntryResource(Resource<?> parent,
                     K key,
                     V value)
Method Detail

getKey

public K getKey()

getValue

public V getValue()

delete

public boolean delete()
               throws UnsupportedOperationException
Description copied from interface: Resource
Delete this resource, return true if successful, false if not.

Throws:
UnsupportedOperationException - if deleting is not supported by the underlying implementation.

delete

public boolean delete(boolean recursive)
               throws UnsupportedOperationException
Description copied from interface: Resource
Delete this resource, return true if successful, false if not.

Parameters:
recursive - if false and this resource both supports recursive deletion and contains children, deletion will not occur; otherwise, if true, deletion will propagate to all child resources. Implementations may choose simply to delegate to Resource.delete()
Throws:
UnsupportedOperationException - if deleting is not supported by the underlying implementation.

getName

public String getName()
Description copied from interface: Resource
Return the common name of the resource. If it's a file, for instance, just the file name.

Returns:
The name of the resource.

getUnderlyingResourceObject

public Map.Entry<K,V> getUnderlyingResourceObject()
Description copied from interface: Resource
Get the underlying object represented by this Resource


doListResources

protected List<Resource<?>> doListResources()
Description copied from class: AbstractResource
Strategy method for returning child resources. Subclasses should implement or override this method.

Specified by:
doListResources in class AbstractResource<Map.Entry<K,V>>
Returns:

Forge - Shell API 1.2.0.Final

Copyright © 2013 JBoss by Red Hat. All Rights Reserved.