Then we need to add it to the documentation that null indicates; use the
provided key as partitioning-key.


On Wed, Aug 28, 2013 at 12:32 PM, Mehmet Dogan <notifications@github.com>wrote:

> In
> hazelcast/src/main/java/com/hazelcast/partition/strategy/StringAndPartitionAwarePartitionStrategy.java:
>
> > +import com.hazelcast.core.PartitionStrategy;
> > +import com.hazelcast.util.PartitionKeyUtil;
> > +
> > +/**
> > + * @author mdogan 8/25/13
> > + */
> > +public class StringAndPartitionAwarePartitionStrategy implements PartitionStrategy {
> > +
> > +    public Object getPartitionKey(Object key) {
> > +        if (key instanceof String) {
> > +            String partitionKey = PartitionKeyUtil.getPartitionKey((String) key);
> > +            return partitionKey != key ? partitionKey : null;
> > +        } else if (key instanceof PartitionAware) {
> > +            return ((PartitionAware) key).getPartitionKey();
> > +        }
> > +        return null;
>
> Otherwise I need to check'
>
> if (pk != obj) {....}
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/hazelcast/hazelcast/pull/815/files#r6029071>
> .
>