
com.redislabs.lettusearch.search.SortBy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lettusearch Show documentation
Show all versions of lettusearch Show documentation
Java client for RediSearch based on Lettuce
package com.redislabs.lettusearch.search;
import static com.redislabs.lettusearch.protocol.CommandKeyword.ASC;
import static com.redislabs.lettusearch.protocol.CommandKeyword.DESC;
import com.redislabs.lettusearch.RediSearchArgument;
import com.redislabs.lettusearch.protocol.RediSearchCommandArgs;
import lombok.Builder;
import lombok.Builder.Default;
import lombok.Data;
@Data
@Builder
public class SortBy implements RediSearchArgument {
public final static Direction DEFAULT_DIRECTION = Direction.Ascending;
private K field;
@Default
private Direction direction = DEFAULT_DIRECTION;
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public void build(RediSearchCommandArgs args) {
args.addKey(field);
args.add(direction == Direction.Ascending ? ASC : DESC);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy