Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   *
   *  Copyright 2011 Netflix, Inc.
   *
   *     Licensed under the Apache License, Version 2.0 (the "License");
   *     you may not use this file except in compliance with the License.
   *     You may obtain a copy of the License at
   *
   *         http://www.apache.org/licenses/LICENSE-2.0
  *
  *     Unless required by applicable law or agreed to in writing, software
  *     distributed under the License is distributed on an "AS IS" BASIS,
  *     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  *     See the License for the specific language governing permissions and
  *     limitations under the License.
  *
  */
 
 package com.netflix.curator.framework.api.transaction;
 
Holds the result of one transactional operation
 
 {
     private final OperationType type;
     private final String        forPath;
     private final String        resultPath;
     private final Stat          resultStat;

    
Utility that can be passed to Google Guava to find a particular result. E.g.
 Iterables.find(results, CuratorTransactionResult.ofTypeAndPath(OperationType.CREATE, path))
 

Parameters:
type operation type
forPath path
Returns:
predicate
 
     public static Predicate<CuratorTransactionResult>       ofTypeAndPath(final OperationType typefinal String forPath)
     {
         return new Predicate<CuratorTransactionResult>()
         {
             @Override
             public boolean apply(CuratorTransactionResult result)
             {
                 return (result.getType() == type) && result.getForPath().equals(forPath);
             }
         };
     }
 
     public CuratorTransactionResult(OperationType typeString forPathString resultPathStat resultStat)
     {
         this. = forPath;
         this. = resultPath;
         this. = resultStat;
         this. = type;
     }

    
Returns the operation type

Returns:
operation type
 
     public OperationType getType()
     {
         return ;
     }

    
Returns the path that was passed to the operation when added

Returns:
operation input path
 
     public String getForPath()
     {
         return ;
     }

    
Returns the operation generated path or null. i.e. CuratorTransaction.create() using an EPHEMERAL mode generates the created path plus its sequence number.

Returns:
generated path or null
 
     public String getResultPath()
     {
         return ;
     }

    
Returns the operation generated stat or null. i.e. CuratorTransaction.setData() generates a stat object.

Returns:
generated stat or null
    public Stat getResultStat()
    {
        return ;
    }
New to GrepCode? Check out our FAQ X