org.jboss.dna.connector.federation.contribution
Class TwoPropertyContribution

java.lang.Object
  extended by org.jboss.dna.connector.federation.contribution.Contribution
      extended by org.jboss.dna.connector.federation.contribution.NonEmptyContribution
          extended by org.jboss.dna.connector.federation.contribution.TwoPropertyContribution
All Implemented Interfaces:
Serializable

@Immutable
public class TwoPropertyContribution
extends NonEmptyContribution

The record of a source contributing only properties to a node.

Author:
Randall Hauch
See Also:
Serialized Form

Constructor Summary
TwoPropertyContribution(String sourceName, Location locationInSource, DateTime expirationTime, Property property1, Property property2)
          Create a contribution of node properties from the source with the supplied name.
 
Method Summary
 Iterator<Property> getProperties()
          Get the properties that are in this contribution.
 Property getProperty(Name name)
          Get the contributed property with the supplied name.
 int getPropertyCount()
          Get the number of properties that are in this contribution.
 
Methods inherited from class org.jboss.dna.connector.federation.contribution.NonEmptyContribution
equals, getLocationInSource, hashCode
 
Methods inherited from class org.jboss.dna.connector.federation.contribution.Contribution
create, create, create, create, create, createPlaceholder, createPlaceholder, getChildren, getChildrenCount, getExpirationTimeInUtc, getSourceName, isEmpty, isExpired, isPlaceholder, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TwoPropertyContribution

public TwoPropertyContribution(String sourceName,
                               Location locationInSource,
                               DateTime expirationTime,
                               Property property1,
                               Property property2)
Create a contribution of node properties from the source with the supplied name.

Parameters:
sourceName - the name of the source, which may not be null or blank
locationInSource - the path in the source for this contributed information; may not be null
expirationTime - the time (in UTC) after which this contribution should be considered expired, or null if there is no expiration time
property1 - the first property from the source; may not be null
property2 - the first property from the source; may not be null
Method Detail

getProperties

public Iterator<Property> getProperties()
Get the properties that are in this contribution. This resulting iterator does not support removal.

Overrides:
getProperties in class Contribution
Returns:
the properties; never null
See Also:
Contribution.getProperties()

getPropertyCount

public int getPropertyCount()
Get the number of properties that are in this contribution.

Overrides:
getPropertyCount in class Contribution
Returns:
the number of properties
See Also:
Contribution.getPropertyCount()

getProperty

public Property getProperty(Name name)
Get the contributed property with the supplied name.

Overrides:
getProperty in class Contribution
Parameters:
name - the name of the property
Returns:
the contributed property that matches the name, or null if no such property is in the contribution
See Also:
Contribution.getProperty(org.jboss.dna.graph.properties.Name)


Copyright © 2008-Present JBoss a division of Red Hat. All Rights Reserved.