class EdgeLabel extends SchemaLabel {

    public static final EdgeLabel NONE = new EdgeLabel(null, NONE_ID, UNDEF);

    private Id sourceLabel = NONE_ID;
    private Id targetLabel = NONE_ID;
    private Frequency frequency;
    private List<Id> sortKeys;

    public EdgeLabel(final HugeGraph graph, Id id, String name) {
        super(graph, id, name);
        this.frequency = Frequency.DEFAULT;
        this.sortKeys = new ArrayList<>();
    }

    @Override
    public HugeType type() {
        return HugeType.EDGE_LABEL;
    }

    public Frequency frequency() {
        return this.frequency;
    }

    public void frequency(Frequency frequency) {
        this.frequency = frequency;
    }

    public boolean directed() {
        // TODO: implement (do we need this method?)
        return true;
    }

    public String sourceLabelName() {
        return this.graph.vertexLabelOrNone(this.sourceLabel).name();
    }

    public Id sourceLabel() {
        return this.sourceLabel;
    }

    public void sourceLabel(Id id) {<FILL_FUNCTION_BODY>}

    public String targetLabelName() {
        return this.graph.vertexLabelOrNone(this.targetLabel).name();
    }

    public Id targetLabel() {
        return this.targetLabel;
    }

    public void targetLabel(Id id) {
        E.checkArgument(this.targetLabel == NONE_ID,
                        "Not allowed to set target label multi times " +
                        "of edge label '%s'", this.name());
        this.targetLabel = id;
    }

    public boolean linkWithLabel(Id id) {
        return this.sourceLabel.equals(id) || this.targetLabel.equals(id);
    }

    public boolean linkWithVertexLabel(Id label, Directions dir) {
        if (dir.equals(Directions.IN)) {
            return this.targetLabel.equals(label);
        } else if (dir.equals(Directions.OUT)) {
            return this.sourceLabel.equals(label);
        } else if (dir.equals(Directions.BOTH)) {
            return this.targetLabel.equals(label) || this.sourceLabel.equals(label);
        }
        return false;
    }

    public boolean checkLinkEqual(Id sourceLabel, Id targetLabel) {
        return this.sourceLabel.equals(sourceLabel) &&
               this.targetLabel.equals(targetLabel);
    }

    public boolean existSortKeys() {
        return !this.sortKeys.isEmpty();
    }

    public List<Id> sortKeys() {
        return Collections.unmodifiableList(this.sortKeys);
    }

    public void sortKey(Id id) {
        this.sortKeys.add(id);
    }

    public void sortKeys(Id... ids) {
        this.sortKeys.addAll(Arrays.asList(ids));
    }

    public boolean hasSameContent(EdgeLabel other) {
        return super.hasSameContent(other) &&
               this.frequency == other.frequency &&
               Objects.equal(this.sourceLabelName(), other.sourceLabelName()) &&
               Objects.equal(this.targetLabelName(), other.targetLabelName()) &&
               Objects.equal(this.graph.mapPkId2Name(this.sortKeys),
                             other.graph.mapPkId2Name(other.sortKeys));
    }

    public static EdgeLabel undefined(HugeGraph graph, Id id) {
        return new EdgeLabel(graph, id, UNDEF);
    }

    public interface Builder extends SchemaBuilder<EdgeLabel> {

        Id rebuildIndex();

        Builder link(String sourceLabel, String targetLabel);

        Builder sourceLabel(String label);

        Builder targetLabel(String label);

        Builder singleTime();

        Builder multiTimes();

        Builder sortKeys(String... keys);

        Builder properties(String... properties);

        Builder nullableKeys(String... keys);

        Builder frequency(Frequency frequency);

        Builder ttl(long ttl);

        Builder ttlStartTime(String ttlStartTime);

        Builder enableLabelIndex(boolean enable);

        Builder userdata(String key, Object value);

        Builder userdata(Map<String, Object> userdata);
    }
}

        E.checkArgument(this.sourceLabel == NONE_ID,
                        "Not allowed to set source label multi times " +
                        "of edge label '%s'", this.name());
        this.sourceLabel = id;
    
<methods>public void <init>(org.apache.hugegraph.HugeGraph, org.apache.hugegraph.backend.id.Id, java.lang.String) ,public void addIndexLabel(org.apache.hugegraph.backend.id.Id) ,public transient void addIndexLabels(org.apache.hugegraph.backend.id.Id[]) ,public boolean enableLabelIndex() ,public void enableLabelIndex(boolean) ,public boolean existsIndexLabel() ,public static org.apache.hugegraph.backend.id.Id getEdgeLabelId(org.apache.hugegraph.HugeGraph, java.lang.Object) ,public static org.apache.hugegraph.backend.id.Id getLabelId(org.apache.hugegraph.HugeGraph, org.apache.hugegraph.type.HugeType, java.lang.Object) ,public static org.apache.hugegraph.backend.id.Id getVertexLabelId(org.apache.hugegraph.HugeGraph, java.lang.Object) ,public boolean hasSameContent(org.apache.hugegraph.schema.SchemaLabel) ,public Set<org.apache.hugegraph.backend.id.Id> indexLabels() ,public void nullableKey(org.apache.hugegraph.backend.id.Id) ,public Set<org.apache.hugegraph.backend.id.Id> nullableKeys() ,public transient void nullableKeys(org.apache.hugegraph.backend.id.Id[]) ,public void nullableKeys(Set<org.apache.hugegraph.backend.id.Id>) ,public Set<org.apache.hugegraph.backend.id.Id> properties() ,public void properties(Set<org.apache.hugegraph.backend.id.Id>) ,public transient org.apache.hugegraph.schema.SchemaLabel properties(org.apache.hugegraph.backend.id.Id[]) ,public void property(org.apache.hugegraph.backend.id.Id) ,public void removeIndexLabel(org.apache.hugegraph.backend.id.Id) ,public void ttl(long) ,public long ttl() ,public void ttlStartTime(org.apache.hugegraph.backend.id.Id) ,public org.apache.hugegraph.backend.id.Id ttlStartTime() ,public java.lang.String ttlStartTimeName() ,public boolean undefined() <variables>private boolean enableLabelIndex,private final non-sealed Set<org.apache.hugegraph.backend.id.Id> indexLabels,private final non-sealed Set<org.apache.hugegraph.backend.id.Id> nullableKeys,private final non-sealed Set<org.apache.hugegraph.backend.id.Id> properties,private long ttl,private org.apache.hugegraph.backend.id.Id ttlStartTime