Package org.apache.sling.caconfig.resource.spi

## Class ContextResource

- java.lang.Object
- - org.apache.sling.caconfig.resource.spi.ContextResource

    @ProviderType
    public final class ContextResource
    extends Object

Holds reference to a context root resource and configuration reference path that was detected for the configuration context.

### Constructor Summary

Constructors
`ContextResource​(@NotNull org.apache.sling.api.resource.Resource resource, String configRef)` Deprecated. Use `ContextResource(Resource, String, int)`
`ContextResource​(@NotNull org.apache.sling.api.resource.Resource resource, String configRef, int serviceRanking)`

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `equals​(Object obj)`
`@Nullable String` `getConfigRef()`
`@NotNull org.apache.sling.api.resource.Resource` `getResource()`
`int` `getServiceRanking()`
`int` `hashCode()`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### ContextResource

    public ContextResource​(@NotNull
                           @NotNull org.apache.sling.api.resource.Resource resource,
                           String configRef,
                           int serviceRanking)

Parameters:
  `resource` - Context root resource
  `configRef` - Config reference (normally a resource path). May be null if the `ConfigurationResourceResolvingStrategy` has it's own concept of detecting the matching configuration.
  `serviceRanking` - Service ranking of the context path strategy implementation

#### ContextResource

    @Deprecated
    public ContextResource​(@NotNull
                           @NotNull org.apache.sling.api.resource.Resource resource,
                           String configRef)

Deprecated.
Use `ContextResource(Resource, String, int)`

Parameters:
  `resource` - Context root resource
  `configRef` - Config reference (normally a resource path). May be null if the `ConfigurationResourceResolvingStrategy` has it's own concept of detecting the matching configuration.

### Method Detail

#### getResource

    @NotNull
    public @NotNull org.apache.sling.api.resource.Resource getResource()

Returns:
  Context root resource

#### getConfigRef

    @Nullable
    public @Nullable String getConfigRef()

Returns:
  Config reference (normally a resource path). May be null if the `ConfigurationResourceResolvingStrategy` has it's own concept of detecting the matching configuration.

#### getServiceRanking

    public int getServiceRanking()

Returns:
  Service ranking of the context path strategy implementation

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### equals

    public boolean equals​(Object obj)

Overrides:
  `equals` in class `Object`