All Downloads are FREE. Search and download functionalities are using the official Maven repository.

odata.test.trip.pin.entity.collection.request.TripCollectionRequest Maven / Gradle / Ivy

There is a newer version: 0.1.13
Show newest version
package odata.test.trip.pin.entity.collection.request;

import com.github.davidmoten.odata.client.CollectionPageEntityRequest;
import com.github.davidmoten.odata.client.ContextPath;
import com.github.davidmoten.odata.client.NameValue;
import odata.test.trip.pin.entity.Trip;
import odata.test.trip.pin.entity.collection.request.PhotoCollectionRequest;
import odata.test.trip.pin.entity.collection.request.PlanItemCollectionRequest;
import odata.test.trip.pin.entity.request.PhotoRequest;
import odata.test.trip.pin.entity.request.PlanItemRequest;
import odata.test.trip.pin.entity.request.TripRequest;
import odata.test.trip.pin.schema.SchemaInfo;

public final class TripCollectionRequest extends CollectionPageEntityRequest{

    protected ContextPath contextPath;

    public TripCollectionRequest(ContextPath contextPath) {
        super(contextPath, Trip.class, cp -> new TripRequest(cp), SchemaInfo.INSTANCE);
        this.contextPath = contextPath;
    }

    public PhotoCollectionRequest photos() {
        return new PhotoCollectionRequest(contextPath.addSegment("Photos"));
    }

    public PhotoRequest photos(Long id) {
        return new PhotoRequest(contextPath.addSegment("Photos").addKeys(new NameValue(id.toString())));
    }

    public PlanItemCollectionRequest planItems() {
        return new PlanItemCollectionRequest(contextPath.addSegment("PlanItems"));
    }

    public PlanItemRequest planItems(Integer planItemId) {
        return new PlanItemRequest(contextPath.addSegment("PlanItems").addKeys(new NameValue(planItemId.toString())));
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy