io.github.springwolf.asyncapi.v3.model.channel.ChannelReference Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of springwolf-asyncapi Show documentation
Show all versions of springwolf-asyncapi Show documentation
Springwolf implementation of the AsyncApi specification
// SPDX-License-Identifier: Apache-2.0
package io.github.springwolf.asyncapi.v3.model.channel;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.github.springwolf.asyncapi.v3.model.Reference;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ChannelReference implements Channel, Reference {
@JsonIgnore
private String ref;
@Override
public String getRef() {
return ref;
}
public static ChannelReference fromChannel(ChannelObject channel) {
return new ChannelReference("#/channels/" + channel.getChannelId());
}
public static ChannelReference fromChannel(String channelId) {
return new ChannelReference("#/channels/" + channelId);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy