org.opentripplanner.ext.transmodelapi.model.network.PresentationType Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of otp Show documentation
Show all versions of otp Show documentation
The OpenTripPlanner multimodal journey planning system
package org.opentripplanner.ext.transmodelapi.model.network;
import graphql.Scalars;
import graphql.schema.GraphQLFieldDefinition;
import graphql.schema.GraphQLObjectType;
import org.opentripplanner.model.Route;
public class PresentationType {
public static GraphQLObjectType create() {
return GraphQLObjectType.newObject()
.name("Presentation")
.description("Types describing common presentation properties")
.field(GraphQLFieldDefinition.newFieldDefinition()
.name("colour")
.type(Scalars.GraphQLString)
.dataFetcher(environment -> ((Route) environment.getSource()).getColor())
.build())
.field(GraphQLFieldDefinition.newFieldDefinition()
.name("textColour")
.type(Scalars.GraphQLString)
.dataFetcher(environment -> ((Route) environment.getSource()).getTextColor())
.build())
.build();
}
}