Add IsOrExtends to astool; regenerate ActivityStreams code.

The IsOrExtends will return true if an object is a type T or extends
from that type in the ActivityStreams vocabulary.
このコミットが含まれているのは:
Cory Slep 2019-03-13 21:09:51 +01:00
コミット 1ed044f7cf
59個のファイルの変更1147行の追加113行の削除

ファイルの表示

@ -877,7 +877,7 @@ func (c *Converter) packageManager(s, vocabName string) (pkg *gen.PackageManager
// are the ones typically used by developers. // are the ones typically used by developers.
func (c *Converter) rootFiles(pkg gen.Package, vocabName string, v vocabulary, m *gen.ManagerGenerator) (f []*File, e error) { func (c *Converter) rootFiles(pkg gen.Package, vocabName string, v vocabulary, m *gen.ManagerGenerator) (f []*File, e error) {
pg := gen.NewPackageGenerator(c.typePropertyVocabName, m, c.typeProperty) pg := gen.NewPackageGenerator(c.typePropertyVocabName, m, c.typeProperty)
typeCtors, propCtors, ext, disj, extBy := pg.RootDefinitions(vocabName, v.typeArray(), v.propArray()) typeCtors, propCtors, ext, disj, extBy, isA := pg.RootDefinitions(vocabName, v.typeArray(), v.propArray())
lowerVocabName := strings.ToLower(vocabName) lowerVocabName := strings.ToLower(vocabName)
if file := funcsToFile(pkg, typeCtors, fmt.Sprintf("gen_pkg_%s_type_constructors.go", lowerVocabName)); file != nil { if file := funcsToFile(pkg, typeCtors, fmt.Sprintf("gen_pkg_%s_type_constructors.go", lowerVocabName)); file != nil {
f = append(f, file) f = append(f, file)
@ -894,6 +894,9 @@ func (c *Converter) rootFiles(pkg gen.Package, vocabName string, v vocabulary, m
if file := funcsToFile(pkg, extBy, fmt.Sprintf("gen_pkg_%s_extendedby.go", lowerVocabName)); file != nil { if file := funcsToFile(pkg, extBy, fmt.Sprintf("gen_pkg_%s_extendedby.go", lowerVocabName)); file != nil {
f = append(f, file) f = append(f, file)
} }
if file := funcsToFile(pkg, isA, fmt.Sprintf("gen_pkg_%s_isorextends.go", lowerVocabName)); file != nil {
f = append(f, file)
}
return return
} }

ファイルの表示

@ -238,7 +238,7 @@ func (t *PackageGenerator) InitDefinitions(pkg Package, tgs []*TypeGenerator, pg
} }
// RootDefinitions creates functions needed at the root level of the package declarations. // RootDefinitions creates functions needed at the root level of the package declarations.
func (t *PackageGenerator) RootDefinitions(vocabName string, tgs []*TypeGenerator, pgs []*PropertyGenerator) (typeCtors, propCtors, ext, disj, extBy []*codegen.Function) { func (t *PackageGenerator) RootDefinitions(vocabName string, tgs []*TypeGenerator, pgs []*PropertyGenerator) (typeCtors, propCtors, ext, disj, extBy, isA []*codegen.Function) {
return rootDefinitions(vocabName, t.m, tgs, pgs) return rootDefinitions(vocabName, t.m, tgs, pgs)
} }
@ -337,7 +337,7 @@ func publicTypeDefinitions(tgs []*TypeGenerator) (typeI *codegen.Interface) {
// rootDefinitions creates common functions needed at the root level of the // rootDefinitions creates common functions needed at the root level of the
// package declarations. // package declarations.
func rootDefinitions(vocabName string, m *ManagerGenerator, tgs []*TypeGenerator, pgs []*PropertyGenerator) (typeCtors, propCtors, ext, disj, extBy []*codegen.Function) { func rootDefinitions(vocabName string, m *ManagerGenerator, tgs []*TypeGenerator, pgs []*PropertyGenerator) (typeCtors, propCtors, ext, disj, extBy, isA []*codegen.Function) {
// Type constructors // Type constructors
for _, tg := range tgs { for _, tg := range tgs {
typeCtors = append(typeCtors, codegen.NewCommentedFunction( typeCtors = append(typeCtors, codegen.NewCommentedFunction(
@ -356,6 +356,22 @@ func rootDefinitions(vocabName string, m *ManagerGenerator, tgs []*TypeGenerator
for _, pg := range pgs { for _, pg := range pgs {
propCtors = append(propCtors, toPublicConstructor(vocabName, m, pg)) propCtors = append(propCtors, toPublicConstructor(vocabName, m, pg))
} }
// Is
for _, tg := range tgs {
f := tg.isATypeDefinition()
name := fmt.Sprintf("%s%s%s", isAMethod, vocabName, tg.TypeName())
isA = append(isA, codegen.NewCommentedFunction(
m.pkg.Path(),
name,
[]jen.Code{jen.Id("other").Qual(tg.PublicPackage().Path(), typeInterfaceName)},
[]jen.Code{jen.Bool()},
[]jen.Code{
jen.Return(
f.Call(jen.Id("other")),
),
},
fmt.Sprintf("%s returns true if the other provided type is the %s type or extends from the %s type.", name, tg.TypeName(), tg.TypeName())))
}
// Extends // Extends
for _, tg := range tgs { for _, tg := range tgs {
f, _ := tg.extendsDefinition() f, _ := tg.extendsDefinition()
@ -402,7 +418,7 @@ func rootDefinitions(vocabName string, m *ManagerGenerator, tgs []*TypeGenerator
f.Call(jen.Id("other")), f.Call(jen.Id("other")),
), ),
}, },
fmt.Sprintf("%s returns true if the other's type extends from %s.", name, tg.TypeName()))) fmt.Sprintf("%s returns true if the other's type extends from %s. Note that it returns false if the types are the same; see the %q variant instead.", name, tg.TypeName(), isAMethod)))
} }
return return
} }

ファイルの表示

@ -17,6 +17,7 @@ const (
extendedByMethod = "IsExtendedBy" extendedByMethod = "IsExtendedBy"
extendingMethod = "IsExtending" extendingMethod = "IsExtending"
extendsMethod = "Extends" extendsMethod = "Extends"
isAMethod = "IsOrExtends"
disjointWithMethod = "IsDisjointWith" disjointWithMethod = "IsDisjointWith"
typeNameMethod = "GetTypeName" typeNameMethod = "GetTypeName"
vocabURIMethod = "VocabularyURI" vocabURIMethod = "VocabularyURI"
@ -345,6 +346,13 @@ func (t *TypeGenerator) extendedByFnName() string {
return fmt.Sprintf("%s%s", t.TypeName(), extendedByMethod) return fmt.Sprintf("%s%s", t.TypeName(), extendedByMethod)
} }
// isATypeFnName determines the name of the IsA function, which determines if
// this Type is the same as the other one or if another ActivityStreams type
// extends this one.
func (t *TypeGenerator) isATypeFnName() string {
return fmt.Sprintf("%s%s", isAMethod, t.TypeName())
}
// disjointWithFnName determines the name of the DisjointWith function, which // disjointWithFnName determines the name of the DisjointWith function, which
// determines if another ActivityStreams type is disjoint with this one. // determines if another ActivityStreams type is disjoint with this one.
func (t *TypeGenerator) disjointWithFnName() string { func (t *TypeGenerator) disjointWithFnName() string {
@ -397,6 +405,7 @@ func (t *TypeGenerator) Definition() *codegen.Struct {
), ),
[]*codegen.Function{ []*codegen.Function{
constructor, constructor,
t.isATypeDefinition(),
t.extendedByDefinition(), t.extendedByDefinition(),
extendsFn, extendsFn,
t.disjointWithDefinition(), t.disjointWithDefinition(),
@ -587,6 +596,30 @@ func (t *TypeGenerator) getAllChildrenExtendedBy(s []string, tg *TypeGenerator)
return s return s
} }
// isATypeDefinition generates the golang function for determining if another
// ActivityStreams type is this type or extends this type. It requires the Type
// interface.
func (t *TypeGenerator) isATypeDefinition() *codegen.Function {
return codegen.NewCommentedFunction(
t.PrivatePackage().Path(),
t.isATypeFnName(),
[]jen.Code{jen.Id("other").Qual(t.PublicPackage().Path(), typeInterfaceName)},
[]jen.Code{jen.Bool()},
[]jen.Code{
jen.If(
jen.Id("other").Dot(typeNameMethod).Call().Op("==").Lit(t.TypeName()),
).Block(
jen.Return(jen.True()),
),
jen.Return(
jen.Id(codegen.This()).Dot(t.extendedByFnName()).Call(
jen.Id("other"),
),
),
},
fmt.Sprintf("%s returns true if the other provided type is the %s type or extends from the %s type.", t.isATypeFnName(), t.TypeName(), t.TypeName()))
}
// extendedByDefinition generates the golang function for determining if // extendedByDefinition generates the golang function for determining if
// another ActivityStreams type extends this type. It requires the Type // another ActivityStreams type extends this type. It requires the Type
// interface. // interface.
@ -617,7 +650,7 @@ func (t *TypeGenerator) extendedByDefinition() *codegen.Function {
[]jen.Code{jen.Id("other").Qual(t.PublicPackage().Path(), typeInterfaceName)}, []jen.Code{jen.Id("other").Qual(t.PublicPackage().Path(), typeInterfaceName)},
[]jen.Code{jen.Bool()}, []jen.Code{jen.Bool()},
impl, impl,
fmt.Sprintf("%s returns true if the other provided type extends from the %s type.", t.extendedByFnName(), t.TypeName())) fmt.Sprintf("%s returns true if the other provided type extends from the %s type. Note that it returns false if the types are the same; see the %q variant instead.", t.extendedByFnName(), t.TypeName(), t.isATypeFnName()))
} }
// getAllChildrenDisjointWith recursivley determines all the child types that this // getAllChildrenDisjointWith recursivley determines all the child types that this

ファイルの表示

@ -59,325 +59,379 @@ import (
) )
// ActivityStreamsAcceptIsExtendedBy returns true if the other's type extends from // ActivityStreamsAcceptIsExtendedBy returns true if the other's type extends from
// Accept. // Accept. Note that it returns false if the types are the same; see the
// "IsOrExtends" variant instead.
func ActivityStreamsAcceptIsExtendedBy(other vocab.Type) bool { func ActivityStreamsAcceptIsExtendedBy(other vocab.Type) bool {
return typeaccept.AcceptIsExtendedBy(other) return typeaccept.AcceptIsExtendedBy(other)
} }
// ActivityStreamsActivityIsExtendedBy returns true if the other's type extends // ActivityStreamsActivityIsExtendedBy returns true if the other's type extends
// from Activity. // from Activity. Note that it returns false if the types are the same; see
// the "IsOrExtends" variant instead.
func ActivityStreamsActivityIsExtendedBy(other vocab.Type) bool { func ActivityStreamsActivityIsExtendedBy(other vocab.Type) bool {
return typeactivity.ActivityIsExtendedBy(other) return typeactivity.ActivityIsExtendedBy(other)
} }
// ActivityStreamsAddIsExtendedBy returns true if the other's type extends from // ActivityStreamsAddIsExtendedBy returns true if the other's type extends from
// Add. // Add. Note that it returns false if the types are the same; see the
// "IsOrExtends" variant instead.
func ActivityStreamsAddIsExtendedBy(other vocab.Type) bool { func ActivityStreamsAddIsExtendedBy(other vocab.Type) bool {
return typeadd.AddIsExtendedBy(other) return typeadd.AddIsExtendedBy(other)
} }
// ActivityStreamsAnnounceIsExtendedBy returns true if the other's type extends // ActivityStreamsAnnounceIsExtendedBy returns true if the other's type extends
// from Announce. // from Announce. Note that it returns false if the types are the same; see
// the "IsOrExtends" variant instead.
func ActivityStreamsAnnounceIsExtendedBy(other vocab.Type) bool { func ActivityStreamsAnnounceIsExtendedBy(other vocab.Type) bool {
return typeannounce.AnnounceIsExtendedBy(other) return typeannounce.AnnounceIsExtendedBy(other)
} }
// ActivityStreamsApplicationIsExtendedBy returns true if the other's type extends // ActivityStreamsApplicationIsExtendedBy returns true if the other's type extends
// from Application. // from Application. Note that it returns false if the types are the same; see
// the "IsOrExtends" variant instead.
func ActivityStreamsApplicationIsExtendedBy(other vocab.Type) bool { func ActivityStreamsApplicationIsExtendedBy(other vocab.Type) bool {
return typeapplication.ApplicationIsExtendedBy(other) return typeapplication.ApplicationIsExtendedBy(other)
} }
// ActivityStreamsArriveIsExtendedBy returns true if the other's type extends from // ActivityStreamsArriveIsExtendedBy returns true if the other's type extends from
// Arrive. // Arrive. Note that it returns false if the types are the same; see the
// "IsOrExtends" variant instead.
func ActivityStreamsArriveIsExtendedBy(other vocab.Type) bool { func ActivityStreamsArriveIsExtendedBy(other vocab.Type) bool {
return typearrive.ArriveIsExtendedBy(other) return typearrive.ArriveIsExtendedBy(other)
} }
// ActivityStreamsArticleIsExtendedBy returns true if the other's type extends // ActivityStreamsArticleIsExtendedBy returns true if the other's type extends
// from Article. // from Article. Note that it returns false if the types are the same; see the
// "IsOrExtends" variant instead.
func ActivityStreamsArticleIsExtendedBy(other vocab.Type) bool { func ActivityStreamsArticleIsExtendedBy(other vocab.Type) bool {
return typearticle.ArticleIsExtendedBy(other) return typearticle.ArticleIsExtendedBy(other)
} }
// ActivityStreamsAudioIsExtendedBy returns true if the other's type extends from // ActivityStreamsAudioIsExtendedBy returns true if the other's type extends from
// Audio. // Audio. Note that it returns false if the types are the same; see the
// "IsOrExtends" variant instead.
func ActivityStreamsAudioIsExtendedBy(other vocab.Type) bool { func ActivityStreamsAudioIsExtendedBy(other vocab.Type) bool {
return typeaudio.AudioIsExtendedBy(other) return typeaudio.AudioIsExtendedBy(other)
} }
// ActivityStreamsBlockIsExtendedBy returns true if the other's type extends from // ActivityStreamsBlockIsExtendedBy returns true if the other's type extends from
// Block. // Block. Note that it returns false if the types are the same; see the
// "IsOrExtends" variant instead.
func ActivityStreamsBlockIsExtendedBy(other vocab.Type) bool { func ActivityStreamsBlockIsExtendedBy(other vocab.Type) bool {
return typeblock.BlockIsExtendedBy(other) return typeblock.BlockIsExtendedBy(other)
} }
// ActivityStreamsCollectionIsExtendedBy returns true if the other's type extends // ActivityStreamsCollectionIsExtendedBy returns true if the other's type extends
// from Collection. // from Collection. Note that it returns false if the types are the same; see
// the "IsOrExtends" variant instead.
func ActivityStreamsCollectionIsExtendedBy(other vocab.Type) bool { func ActivityStreamsCollectionIsExtendedBy(other vocab.Type) bool {
return typecollection.CollectionIsExtendedBy(other) return typecollection.CollectionIsExtendedBy(other)
} }
// ActivityStreamsCollectionPageIsExtendedBy returns true if the other's type // ActivityStreamsCollectionPageIsExtendedBy returns true if the other's type
// extends from CollectionPage. // extends from CollectionPage. Note that it returns false if the types are
// the same; see the "IsOrExtends" variant instead.
func ActivityStreamsCollectionPageIsExtendedBy(other vocab.Type) bool { func ActivityStreamsCollectionPageIsExtendedBy(other vocab.Type) bool {
return typecollectionpage.CollectionPageIsExtendedBy(other) return typecollectionpage.CollectionPageIsExtendedBy(other)
} }
// ActivityStreamsCreateIsExtendedBy returns true if the other's type extends from // ActivityStreamsCreateIsExtendedBy returns true if the other's type extends from
// Create. // Create. Note that it returns false if the types are the same; see the
// "IsOrExtends" variant instead.
func ActivityStreamsCreateIsExtendedBy(other vocab.Type) bool { func ActivityStreamsCreateIsExtendedBy(other vocab.Type) bool {
return typecreate.CreateIsExtendedBy(other) return typecreate.CreateIsExtendedBy(other)
} }
// ActivityStreamsDeleteIsExtendedBy returns true if the other's type extends from // ActivityStreamsDeleteIsExtendedBy returns true if the other's type extends from
// Delete. // Delete. Note that it returns false if the types are the same; see the
// "IsOrExtends" variant instead.
func ActivityStreamsDeleteIsExtendedBy(other vocab.Type) bool { func ActivityStreamsDeleteIsExtendedBy(other vocab.Type) bool {
return typedelete.DeleteIsExtendedBy(other) return typedelete.DeleteIsExtendedBy(other)
} }
// ActivityStreamsDislikeIsExtendedBy returns true if the other's type extends // ActivityStreamsDislikeIsExtendedBy returns true if the other's type extends
// from Dislike. // from Dislike. Note that it returns false if the types are the same; see the
// "IsOrExtends" variant instead.
func ActivityStreamsDislikeIsExtendedBy(other vocab.Type) bool { func ActivityStreamsDislikeIsExtendedBy(other vocab.Type) bool {
return typedislike.DislikeIsExtendedBy(other) return typedislike.DislikeIsExtendedBy(other)
} }
// ActivityStreamsDocumentIsExtendedBy returns true if the other's type extends // ActivityStreamsDocumentIsExtendedBy returns true if the other's type extends
// from Document. // from Document. Note that it returns false if the types are the same; see
// the "IsOrExtends" variant instead.
func ActivityStreamsDocumentIsExtendedBy(other vocab.Type) bool { func ActivityStreamsDocumentIsExtendedBy(other vocab.Type) bool {
return typedocument.DocumentIsExtendedBy(other) return typedocument.DocumentIsExtendedBy(other)
} }
// ActivityStreamsEventIsExtendedBy returns true if the other's type extends from // ActivityStreamsEventIsExtendedBy returns true if the other's type extends from
// Event. // Event. Note that it returns false if the types are the same; see the
// "IsOrExtends" variant instead.
func ActivityStreamsEventIsExtendedBy(other vocab.Type) bool { func ActivityStreamsEventIsExtendedBy(other vocab.Type) bool {
return typeevent.EventIsExtendedBy(other) return typeevent.EventIsExtendedBy(other)
} }
// ActivityStreamsFlagIsExtendedBy returns true if the other's type extends from // ActivityStreamsFlagIsExtendedBy returns true if the other's type extends from
// Flag. // Flag. Note that it returns false if the types are the same; see the
// "IsOrExtends" variant instead.
func ActivityStreamsFlagIsExtendedBy(other vocab.Type) bool { func ActivityStreamsFlagIsExtendedBy(other vocab.Type) bool {
return typeflag.FlagIsExtendedBy(other) return typeflag.FlagIsExtendedBy(other)
} }
// ActivityStreamsFollowIsExtendedBy returns true if the other's type extends from // ActivityStreamsFollowIsExtendedBy returns true if the other's type extends from
// Follow. // Follow. Note that it returns false if the types are the same; see the
// "IsOrExtends" variant instead.
func ActivityStreamsFollowIsExtendedBy(other vocab.Type) bool { func ActivityStreamsFollowIsExtendedBy(other vocab.Type) bool {
return typefollow.FollowIsExtendedBy(other) return typefollow.FollowIsExtendedBy(other)
} }
// ActivityStreamsGroupIsExtendedBy returns true if the other's type extends from // ActivityStreamsGroupIsExtendedBy returns true if the other's type extends from
// Group. // Group. Note that it returns false if the types are the same; see the
// "IsOrExtends" variant instead.
func ActivityStreamsGroupIsExtendedBy(other vocab.Type) bool { func ActivityStreamsGroupIsExtendedBy(other vocab.Type) bool {
return typegroup.GroupIsExtendedBy(other) return typegroup.GroupIsExtendedBy(other)
} }
// ActivityStreamsIgnoreIsExtendedBy returns true if the other's type extends from // ActivityStreamsIgnoreIsExtendedBy returns true if the other's type extends from
// Ignore. // Ignore. Note that it returns false if the types are the same; see the
// "IsOrExtends" variant instead.
func ActivityStreamsIgnoreIsExtendedBy(other vocab.Type) bool { func ActivityStreamsIgnoreIsExtendedBy(other vocab.Type) bool {
return typeignore.IgnoreIsExtendedBy(other) return typeignore.IgnoreIsExtendedBy(other)
} }
// ActivityStreamsImageIsExtendedBy returns true if the other's type extends from // ActivityStreamsImageIsExtendedBy returns true if the other's type extends from
// Image. // Image. Note that it returns false if the types are the same; see the
// "IsOrExtends" variant instead.
func ActivityStreamsImageIsExtendedBy(other vocab.Type) bool { func ActivityStreamsImageIsExtendedBy(other vocab.Type) bool {
return typeimage.ImageIsExtendedBy(other) return typeimage.ImageIsExtendedBy(other)
} }
// ActivityStreamsIntransitiveActivityIsExtendedBy returns true if the other's // ActivityStreamsIntransitiveActivityIsExtendedBy returns true if the other's
// type extends from IntransitiveActivity. // type extends from IntransitiveActivity. Note that it returns false if the
// types are the same; see the "IsOrExtends" variant instead.
func ActivityStreamsIntransitiveActivityIsExtendedBy(other vocab.Type) bool { func ActivityStreamsIntransitiveActivityIsExtendedBy(other vocab.Type) bool {
return typeintransitiveactivity.IntransitiveActivityIsExtendedBy(other) return typeintransitiveactivity.IntransitiveActivityIsExtendedBy(other)
} }
// ActivityStreamsInviteIsExtendedBy returns true if the other's type extends from // ActivityStreamsInviteIsExtendedBy returns true if the other's type extends from
// Invite. // Invite. Note that it returns false if the types are the same; see the
// "IsOrExtends" variant instead.
func ActivityStreamsInviteIsExtendedBy(other vocab.Type) bool { func ActivityStreamsInviteIsExtendedBy(other vocab.Type) bool {
return typeinvite.InviteIsExtendedBy(other) return typeinvite.InviteIsExtendedBy(other)
} }
// ActivityStreamsJoinIsExtendedBy returns true if the other's type extends from // ActivityStreamsJoinIsExtendedBy returns true if the other's type extends from
// Join. // Join. Note that it returns false if the types are the same; see the
// "IsOrExtends" variant instead.
func ActivityStreamsJoinIsExtendedBy(other vocab.Type) bool { func ActivityStreamsJoinIsExtendedBy(other vocab.Type) bool {
return typejoin.JoinIsExtendedBy(other) return typejoin.JoinIsExtendedBy(other)
} }
// ActivityStreamsLeaveIsExtendedBy returns true if the other's type extends from // ActivityStreamsLeaveIsExtendedBy returns true if the other's type extends from
// Leave. // Leave. Note that it returns false if the types are the same; see the
// "IsOrExtends" variant instead.
func ActivityStreamsLeaveIsExtendedBy(other vocab.Type) bool { func ActivityStreamsLeaveIsExtendedBy(other vocab.Type) bool {
return typeleave.LeaveIsExtendedBy(other) return typeleave.LeaveIsExtendedBy(other)
} }
// ActivityStreamsLikeIsExtendedBy returns true if the other's type extends from // ActivityStreamsLikeIsExtendedBy returns true if the other's type extends from
// Like. // Like. Note that it returns false if the types are the same; see the
// "IsOrExtends" variant instead.
func ActivityStreamsLikeIsExtendedBy(other vocab.Type) bool { func ActivityStreamsLikeIsExtendedBy(other vocab.Type) bool {
return typelike.LikeIsExtendedBy(other) return typelike.LikeIsExtendedBy(other)
} }
// ActivityStreamsLinkIsExtendedBy returns true if the other's type extends from // ActivityStreamsLinkIsExtendedBy returns true if the other's type extends from
// Link. // Link. Note that it returns false if the types are the same; see the
// "IsOrExtends" variant instead.
func ActivityStreamsLinkIsExtendedBy(other vocab.Type) bool { func ActivityStreamsLinkIsExtendedBy(other vocab.Type) bool {
return typelink.LinkIsExtendedBy(other) return typelink.LinkIsExtendedBy(other)
} }
// ActivityStreamsListenIsExtendedBy returns true if the other's type extends from // ActivityStreamsListenIsExtendedBy returns true if the other's type extends from
// Listen. // Listen. Note that it returns false if the types are the same; see the
// "IsOrExtends" variant instead.
func ActivityStreamsListenIsExtendedBy(other vocab.Type) bool { func ActivityStreamsListenIsExtendedBy(other vocab.Type) bool {
return typelisten.ListenIsExtendedBy(other) return typelisten.ListenIsExtendedBy(other)
} }
// ActivityStreamsMentionIsExtendedBy returns true if the other's type extends // ActivityStreamsMentionIsExtendedBy returns true if the other's type extends
// from Mention. // from Mention. Note that it returns false if the types are the same; see the
// "IsOrExtends" variant instead.
func ActivityStreamsMentionIsExtendedBy(other vocab.Type) bool { func ActivityStreamsMentionIsExtendedBy(other vocab.Type) bool {
return typemention.MentionIsExtendedBy(other) return typemention.MentionIsExtendedBy(other)
} }
// ActivityStreamsMoveIsExtendedBy returns true if the other's type extends from // ActivityStreamsMoveIsExtendedBy returns true if the other's type extends from
// Move. // Move. Note that it returns false if the types are the same; see the
// "IsOrExtends" variant instead.
func ActivityStreamsMoveIsExtendedBy(other vocab.Type) bool { func ActivityStreamsMoveIsExtendedBy(other vocab.Type) bool {
return typemove.MoveIsExtendedBy(other) return typemove.MoveIsExtendedBy(other)
} }
// ActivityStreamsNoteIsExtendedBy returns true if the other's type extends from // ActivityStreamsNoteIsExtendedBy returns true if the other's type extends from
// Note. // Note. Note that it returns false if the types are the same; see the
// "IsOrExtends" variant instead.
func ActivityStreamsNoteIsExtendedBy(other vocab.Type) bool { func ActivityStreamsNoteIsExtendedBy(other vocab.Type) bool {
return typenote.NoteIsExtendedBy(other) return typenote.NoteIsExtendedBy(other)
} }
// ActivityStreamsObjectIsExtendedBy returns true if the other's type extends from // ActivityStreamsObjectIsExtendedBy returns true if the other's type extends from
// Object. // Object. Note that it returns false if the types are the same; see the
// "IsOrExtends" variant instead.
func ActivityStreamsObjectIsExtendedBy(other vocab.Type) bool { func ActivityStreamsObjectIsExtendedBy(other vocab.Type) bool {
return typeobject.ObjectIsExtendedBy(other) return typeobject.ObjectIsExtendedBy(other)
} }
// ActivityStreamsOfferIsExtendedBy returns true if the other's type extends from // ActivityStreamsOfferIsExtendedBy returns true if the other's type extends from
// Offer. // Offer. Note that it returns false if the types are the same; see the
// "IsOrExtends" variant instead.
func ActivityStreamsOfferIsExtendedBy(other vocab.Type) bool { func ActivityStreamsOfferIsExtendedBy(other vocab.Type) bool {
return typeoffer.OfferIsExtendedBy(other) return typeoffer.OfferIsExtendedBy(other)
} }
// ActivityStreamsOrderedCollectionIsExtendedBy returns true if the other's type // ActivityStreamsOrderedCollectionIsExtendedBy returns true if the other's type
// extends from OrderedCollection. // extends from OrderedCollection. Note that it returns false if the types are
// the same; see the "IsOrExtends" variant instead.
func ActivityStreamsOrderedCollectionIsExtendedBy(other vocab.Type) bool { func ActivityStreamsOrderedCollectionIsExtendedBy(other vocab.Type) bool {
return typeorderedcollection.OrderedCollectionIsExtendedBy(other) return typeorderedcollection.OrderedCollectionIsExtendedBy(other)
} }
// ActivityStreamsOrderedCollectionPageIsExtendedBy returns true if the other's // ActivityStreamsOrderedCollectionPageIsExtendedBy returns true if the other's
// type extends from OrderedCollectionPage. // type extends from OrderedCollectionPage. Note that it returns false if the
// types are the same; see the "IsOrExtends" variant instead.
func ActivityStreamsOrderedCollectionPageIsExtendedBy(other vocab.Type) bool { func ActivityStreamsOrderedCollectionPageIsExtendedBy(other vocab.Type) bool {
return typeorderedcollectionpage.OrderedCollectionPageIsExtendedBy(other) return typeorderedcollectionpage.OrderedCollectionPageIsExtendedBy(other)
} }
// ActivityStreamsOrganizationIsExtendedBy returns true if the other's type // ActivityStreamsOrganizationIsExtendedBy returns true if the other's type
// extends from Organization. // extends from Organization. Note that it returns false if the types are the
// same; see the "IsOrExtends" variant instead.
func ActivityStreamsOrganizationIsExtendedBy(other vocab.Type) bool { func ActivityStreamsOrganizationIsExtendedBy(other vocab.Type) bool {
return typeorganization.OrganizationIsExtendedBy(other) return typeorganization.OrganizationIsExtendedBy(other)
} }
// ActivityStreamsPageIsExtendedBy returns true if the other's type extends from // ActivityStreamsPageIsExtendedBy returns true if the other's type extends from
// Page. // Page. Note that it returns false if the types are the same; see the
// "IsOrExtends" variant instead.
func ActivityStreamsPageIsExtendedBy(other vocab.Type) bool { func ActivityStreamsPageIsExtendedBy(other vocab.Type) bool {
return typepage.PageIsExtendedBy(other) return typepage.PageIsExtendedBy(other)
} }
// ActivityStreamsPersonIsExtendedBy returns true if the other's type extends from // ActivityStreamsPersonIsExtendedBy returns true if the other's type extends from
// Person. // Person. Note that it returns false if the types are the same; see the
// "IsOrExtends" variant instead.
func ActivityStreamsPersonIsExtendedBy(other vocab.Type) bool { func ActivityStreamsPersonIsExtendedBy(other vocab.Type) bool {
return typeperson.PersonIsExtendedBy(other) return typeperson.PersonIsExtendedBy(other)
} }
// ActivityStreamsPlaceIsExtendedBy returns true if the other's type extends from // ActivityStreamsPlaceIsExtendedBy returns true if the other's type extends from
// Place. // Place. Note that it returns false if the types are the same; see the
// "IsOrExtends" variant instead.
func ActivityStreamsPlaceIsExtendedBy(other vocab.Type) bool { func ActivityStreamsPlaceIsExtendedBy(other vocab.Type) bool {
return typeplace.PlaceIsExtendedBy(other) return typeplace.PlaceIsExtendedBy(other)
} }
// ActivityStreamsProfileIsExtendedBy returns true if the other's type extends // ActivityStreamsProfileIsExtendedBy returns true if the other's type extends
// from Profile. // from Profile. Note that it returns false if the types are the same; see the
// "IsOrExtends" variant instead.
func ActivityStreamsProfileIsExtendedBy(other vocab.Type) bool { func ActivityStreamsProfileIsExtendedBy(other vocab.Type) bool {
return typeprofile.ProfileIsExtendedBy(other) return typeprofile.ProfileIsExtendedBy(other)
} }
// ActivityStreamsQuestionIsExtendedBy returns true if the other's type extends // ActivityStreamsQuestionIsExtendedBy returns true if the other's type extends
// from Question. // from Question. Note that it returns false if the types are the same; see
// the "IsOrExtends" variant instead.
func ActivityStreamsQuestionIsExtendedBy(other vocab.Type) bool { func ActivityStreamsQuestionIsExtendedBy(other vocab.Type) bool {
return typequestion.QuestionIsExtendedBy(other) return typequestion.QuestionIsExtendedBy(other)
} }
// ActivityStreamsReadIsExtendedBy returns true if the other's type extends from // ActivityStreamsReadIsExtendedBy returns true if the other's type extends from
// Read. // Read. Note that it returns false if the types are the same; see the
// "IsOrExtends" variant instead.
func ActivityStreamsReadIsExtendedBy(other vocab.Type) bool { func ActivityStreamsReadIsExtendedBy(other vocab.Type) bool {
return typeread.ReadIsExtendedBy(other) return typeread.ReadIsExtendedBy(other)
} }
// ActivityStreamsRejectIsExtendedBy returns true if the other's type extends from // ActivityStreamsRejectIsExtendedBy returns true if the other's type extends from
// Reject. // Reject. Note that it returns false if the types are the same; see the
// "IsOrExtends" variant instead.
func ActivityStreamsRejectIsExtendedBy(other vocab.Type) bool { func ActivityStreamsRejectIsExtendedBy(other vocab.Type) bool {
return typereject.RejectIsExtendedBy(other) return typereject.RejectIsExtendedBy(other)
} }
// ActivityStreamsRelationshipIsExtendedBy returns true if the other's type // ActivityStreamsRelationshipIsExtendedBy returns true if the other's type
// extends from Relationship. // extends from Relationship. Note that it returns false if the types are the
// same; see the "IsOrExtends" variant instead.
func ActivityStreamsRelationshipIsExtendedBy(other vocab.Type) bool { func ActivityStreamsRelationshipIsExtendedBy(other vocab.Type) bool {
return typerelationship.RelationshipIsExtendedBy(other) return typerelationship.RelationshipIsExtendedBy(other)
} }
// ActivityStreamsRemoveIsExtendedBy returns true if the other's type extends from // ActivityStreamsRemoveIsExtendedBy returns true if the other's type extends from
// Remove. // Remove. Note that it returns false if the types are the same; see the
// "IsOrExtends" variant instead.
func ActivityStreamsRemoveIsExtendedBy(other vocab.Type) bool { func ActivityStreamsRemoveIsExtendedBy(other vocab.Type) bool {
return typeremove.RemoveIsExtendedBy(other) return typeremove.RemoveIsExtendedBy(other)
} }
// ActivityStreamsServiceIsExtendedBy returns true if the other's type extends // ActivityStreamsServiceIsExtendedBy returns true if the other's type extends
// from Service. // from Service. Note that it returns false if the types are the same; see the
// "IsOrExtends" variant instead.
func ActivityStreamsServiceIsExtendedBy(other vocab.Type) bool { func ActivityStreamsServiceIsExtendedBy(other vocab.Type) bool {
return typeservice.ServiceIsExtendedBy(other) return typeservice.ServiceIsExtendedBy(other)
} }
// ActivityStreamsTentativeAcceptIsExtendedBy returns true if the other's type // ActivityStreamsTentativeAcceptIsExtendedBy returns true if the other's type
// extends from TentativeAccept. // extends from TentativeAccept. Note that it returns false if the types are
// the same; see the "IsOrExtends" variant instead.
func ActivityStreamsTentativeAcceptIsExtendedBy(other vocab.Type) bool { func ActivityStreamsTentativeAcceptIsExtendedBy(other vocab.Type) bool {
return typetentativeaccept.TentativeAcceptIsExtendedBy(other) return typetentativeaccept.TentativeAcceptIsExtendedBy(other)
} }
// ActivityStreamsTentativeRejectIsExtendedBy returns true if the other's type // ActivityStreamsTentativeRejectIsExtendedBy returns true if the other's type
// extends from TentativeReject. // extends from TentativeReject. Note that it returns false if the types are
// the same; see the "IsOrExtends" variant instead.
func ActivityStreamsTentativeRejectIsExtendedBy(other vocab.Type) bool { func ActivityStreamsTentativeRejectIsExtendedBy(other vocab.Type) bool {
return typetentativereject.TentativeRejectIsExtendedBy(other) return typetentativereject.TentativeRejectIsExtendedBy(other)
} }
// ActivityStreamsTombstoneIsExtendedBy returns true if the other's type extends // ActivityStreamsTombstoneIsExtendedBy returns true if the other's type extends
// from Tombstone. // from Tombstone. Note that it returns false if the types are the same; see
// the "IsOrExtends" variant instead.
func ActivityStreamsTombstoneIsExtendedBy(other vocab.Type) bool { func ActivityStreamsTombstoneIsExtendedBy(other vocab.Type) bool {
return typetombstone.TombstoneIsExtendedBy(other) return typetombstone.TombstoneIsExtendedBy(other)
} }
// ActivityStreamsTravelIsExtendedBy returns true if the other's type extends from // ActivityStreamsTravelIsExtendedBy returns true if the other's type extends from
// Travel. // Travel. Note that it returns false if the types are the same; see the
// "IsOrExtends" variant instead.
func ActivityStreamsTravelIsExtendedBy(other vocab.Type) bool { func ActivityStreamsTravelIsExtendedBy(other vocab.Type) bool {
return typetravel.TravelIsExtendedBy(other) return typetravel.TravelIsExtendedBy(other)
} }
// ActivityStreamsUndoIsExtendedBy returns true if the other's type extends from // ActivityStreamsUndoIsExtendedBy returns true if the other's type extends from
// Undo. // Undo. Note that it returns false if the types are the same; see the
// "IsOrExtends" variant instead.
func ActivityStreamsUndoIsExtendedBy(other vocab.Type) bool { func ActivityStreamsUndoIsExtendedBy(other vocab.Type) bool {
return typeundo.UndoIsExtendedBy(other) return typeundo.UndoIsExtendedBy(other)
} }
// ActivityStreamsUpdateIsExtendedBy returns true if the other's type extends from // ActivityStreamsUpdateIsExtendedBy returns true if the other's type extends from
// Update. // Update. Note that it returns false if the types are the same; see the
// "IsOrExtends" variant instead.
func ActivityStreamsUpdateIsExtendedBy(other vocab.Type) bool { func ActivityStreamsUpdateIsExtendedBy(other vocab.Type) bool {
return typeupdate.UpdateIsExtendedBy(other) return typeupdate.UpdateIsExtendedBy(other)
} }
// ActivityStreamsVideoIsExtendedBy returns true if the other's type extends from // ActivityStreamsVideoIsExtendedBy returns true if the other's type extends from
// Video. // Video. Note that it returns false if the types are the same; see the
// "IsOrExtends" variant instead.
func ActivityStreamsVideoIsExtendedBy(other vocab.Type) bool { func ActivityStreamsVideoIsExtendedBy(other vocab.Type) bool {
return typevideo.VideoIsExtendedBy(other) return typevideo.VideoIsExtendedBy(other)
} }
// ActivityStreamsViewIsExtendedBy returns true if the other's type extends from // ActivityStreamsViewIsExtendedBy returns true if the other's type extends from
// View. // View. Note that it returns false if the types are the same; see the
// "IsOrExtends" variant instead.
func ActivityStreamsViewIsExtendedBy(other vocab.Type) bool { func ActivityStreamsViewIsExtendedBy(other vocab.Type) bool {
return typeview.ViewIsExtendedBy(other) return typeview.ViewIsExtendedBy(other)
} }

386
streams/gen_pkg_activitystreams_isorextends.go ノーマルファイル
ファイルの表示

@ -0,0 +1,386 @@
package streams
import (
typeaccept "github.com/go-fed/activity/streams/impl/activitystreams/type_accept"
typeactivity "github.com/go-fed/activity/streams/impl/activitystreams/type_activity"
typeadd "github.com/go-fed/activity/streams/impl/activitystreams/type_add"
typeannounce "github.com/go-fed/activity/streams/impl/activitystreams/type_announce"
typeapplication "github.com/go-fed/activity/streams/impl/activitystreams/type_application"
typearrive "github.com/go-fed/activity/streams/impl/activitystreams/type_arrive"
typearticle "github.com/go-fed/activity/streams/impl/activitystreams/type_article"
typeaudio "github.com/go-fed/activity/streams/impl/activitystreams/type_audio"
typeblock "github.com/go-fed/activity/streams/impl/activitystreams/type_block"
typecollection "github.com/go-fed/activity/streams/impl/activitystreams/type_collection"
typecollectionpage "github.com/go-fed/activity/streams/impl/activitystreams/type_collectionpage"
typecreate "github.com/go-fed/activity/streams/impl/activitystreams/type_create"
typedelete "github.com/go-fed/activity/streams/impl/activitystreams/type_delete"
typedislike "github.com/go-fed/activity/streams/impl/activitystreams/type_dislike"
typedocument "github.com/go-fed/activity/streams/impl/activitystreams/type_document"
typeevent "github.com/go-fed/activity/streams/impl/activitystreams/type_event"
typeflag "github.com/go-fed/activity/streams/impl/activitystreams/type_flag"
typefollow "github.com/go-fed/activity/streams/impl/activitystreams/type_follow"
typegroup "github.com/go-fed/activity/streams/impl/activitystreams/type_group"
typeignore "github.com/go-fed/activity/streams/impl/activitystreams/type_ignore"
typeimage "github.com/go-fed/activity/streams/impl/activitystreams/type_image"
typeintransitiveactivity "github.com/go-fed/activity/streams/impl/activitystreams/type_intransitiveactivity"
typeinvite "github.com/go-fed/activity/streams/impl/activitystreams/type_invite"
typejoin "github.com/go-fed/activity/streams/impl/activitystreams/type_join"
typeleave "github.com/go-fed/activity/streams/impl/activitystreams/type_leave"
typelike "github.com/go-fed/activity/streams/impl/activitystreams/type_like"
typelink "github.com/go-fed/activity/streams/impl/activitystreams/type_link"
typelisten "github.com/go-fed/activity/streams/impl/activitystreams/type_listen"
typemention "github.com/go-fed/activity/streams/impl/activitystreams/type_mention"
typemove "github.com/go-fed/activity/streams/impl/activitystreams/type_move"
typenote "github.com/go-fed/activity/streams/impl/activitystreams/type_note"
typeobject "github.com/go-fed/activity/streams/impl/activitystreams/type_object"
typeoffer "github.com/go-fed/activity/streams/impl/activitystreams/type_offer"
typeorderedcollection "github.com/go-fed/activity/streams/impl/activitystreams/type_orderedcollection"
typeorderedcollectionpage "github.com/go-fed/activity/streams/impl/activitystreams/type_orderedcollectionpage"
typeorganization "github.com/go-fed/activity/streams/impl/activitystreams/type_organization"
typepage "github.com/go-fed/activity/streams/impl/activitystreams/type_page"
typeperson "github.com/go-fed/activity/streams/impl/activitystreams/type_person"
typeplace "github.com/go-fed/activity/streams/impl/activitystreams/type_place"
typeprofile "github.com/go-fed/activity/streams/impl/activitystreams/type_profile"
typequestion "github.com/go-fed/activity/streams/impl/activitystreams/type_question"
typeread "github.com/go-fed/activity/streams/impl/activitystreams/type_read"
typereject "github.com/go-fed/activity/streams/impl/activitystreams/type_reject"
typerelationship "github.com/go-fed/activity/streams/impl/activitystreams/type_relationship"
typeremove "github.com/go-fed/activity/streams/impl/activitystreams/type_remove"
typeservice "github.com/go-fed/activity/streams/impl/activitystreams/type_service"
typetentativeaccept "github.com/go-fed/activity/streams/impl/activitystreams/type_tentativeaccept"
typetentativereject "github.com/go-fed/activity/streams/impl/activitystreams/type_tentativereject"
typetombstone "github.com/go-fed/activity/streams/impl/activitystreams/type_tombstone"
typetravel "github.com/go-fed/activity/streams/impl/activitystreams/type_travel"
typeundo "github.com/go-fed/activity/streams/impl/activitystreams/type_undo"
typeupdate "github.com/go-fed/activity/streams/impl/activitystreams/type_update"
typevideo "github.com/go-fed/activity/streams/impl/activitystreams/type_video"
typeview "github.com/go-fed/activity/streams/impl/activitystreams/type_view"
vocab "github.com/go-fed/activity/streams/vocab"
)
// IsOrExtendsActivityStreamsAccept returns true if the other provided type is the
// Accept type or extends from the Accept type.
func IsOrExtendsActivityStreamsAccept(other vocab.Type) bool {
return typeaccept.IsOrExtendsAccept(other)
}
// IsOrExtendsActivityStreamsActivity returns true if the other provided type is
// the Activity type or extends from the Activity type.
func IsOrExtendsActivityStreamsActivity(other vocab.Type) bool {
return typeactivity.IsOrExtendsActivity(other)
}
// IsOrExtendsActivityStreamsAdd returns true if the other provided type is the
// Add type or extends from the Add type.
func IsOrExtendsActivityStreamsAdd(other vocab.Type) bool {
return typeadd.IsOrExtendsAdd(other)
}
// IsOrExtendsActivityStreamsAnnounce returns true if the other provided type is
// the Announce type or extends from the Announce type.
func IsOrExtendsActivityStreamsAnnounce(other vocab.Type) bool {
return typeannounce.IsOrExtendsAnnounce(other)
}
// IsOrExtendsActivityStreamsApplication returns true if the other provided type
// is the Application type or extends from the Application type.
func IsOrExtendsActivityStreamsApplication(other vocab.Type) bool {
return typeapplication.IsOrExtendsApplication(other)
}
// IsOrExtendsActivityStreamsArrive returns true if the other provided type is the
// Arrive type or extends from the Arrive type.
func IsOrExtendsActivityStreamsArrive(other vocab.Type) bool {
return typearrive.IsOrExtendsArrive(other)
}
// IsOrExtendsActivityStreamsArticle returns true if the other provided type is
// the Article type or extends from the Article type.
func IsOrExtendsActivityStreamsArticle(other vocab.Type) bool {
return typearticle.IsOrExtendsArticle(other)
}
// IsOrExtendsActivityStreamsAudio returns true if the other provided type is the
// Audio type or extends from the Audio type.
func IsOrExtendsActivityStreamsAudio(other vocab.Type) bool {
return typeaudio.IsOrExtendsAudio(other)
}
// IsOrExtendsActivityStreamsBlock returns true if the other provided type is the
// Block type or extends from the Block type.
func IsOrExtendsActivityStreamsBlock(other vocab.Type) bool {
return typeblock.IsOrExtendsBlock(other)
}
// IsOrExtendsActivityStreamsCollection returns true if the other provided type is
// the Collection type or extends from the Collection type.
func IsOrExtendsActivityStreamsCollection(other vocab.Type) bool {
return typecollection.IsOrExtendsCollection(other)
}
// IsOrExtendsActivityStreamsCollectionPage returns true if the other provided
// type is the CollectionPage type or extends from the CollectionPage type.
func IsOrExtendsActivityStreamsCollectionPage(other vocab.Type) bool {
return typecollectionpage.IsOrExtendsCollectionPage(other)
}
// IsOrExtendsActivityStreamsCreate returns true if the other provided type is the
// Create type or extends from the Create type.
func IsOrExtendsActivityStreamsCreate(other vocab.Type) bool {
return typecreate.IsOrExtendsCreate(other)
}
// IsOrExtendsActivityStreamsDelete returns true if the other provided type is the
// Delete type or extends from the Delete type.
func IsOrExtendsActivityStreamsDelete(other vocab.Type) bool {
return typedelete.IsOrExtendsDelete(other)
}
// IsOrExtendsActivityStreamsDislike returns true if the other provided type is
// the Dislike type or extends from the Dislike type.
func IsOrExtendsActivityStreamsDislike(other vocab.Type) bool {
return typedislike.IsOrExtendsDislike(other)
}
// IsOrExtendsActivityStreamsDocument returns true if the other provided type is
// the Document type or extends from the Document type.
func IsOrExtendsActivityStreamsDocument(other vocab.Type) bool {
return typedocument.IsOrExtendsDocument(other)
}
// IsOrExtendsActivityStreamsEvent returns true if the other provided type is the
// Event type or extends from the Event type.
func IsOrExtendsActivityStreamsEvent(other vocab.Type) bool {
return typeevent.IsOrExtendsEvent(other)
}
// IsOrExtendsActivityStreamsFlag returns true if the other provided type is the
// Flag type or extends from the Flag type.
func IsOrExtendsActivityStreamsFlag(other vocab.Type) bool {
return typeflag.IsOrExtendsFlag(other)
}
// IsOrExtendsActivityStreamsFollow returns true if the other provided type is the
// Follow type or extends from the Follow type.
func IsOrExtendsActivityStreamsFollow(other vocab.Type) bool {
return typefollow.IsOrExtendsFollow(other)
}
// IsOrExtendsActivityStreamsGroup returns true if the other provided type is the
// Group type or extends from the Group type.
func IsOrExtendsActivityStreamsGroup(other vocab.Type) bool {
return typegroup.IsOrExtendsGroup(other)
}
// IsOrExtendsActivityStreamsIgnore returns true if the other provided type is the
// Ignore type or extends from the Ignore type.
func IsOrExtendsActivityStreamsIgnore(other vocab.Type) bool {
return typeignore.IsOrExtendsIgnore(other)
}
// IsOrExtendsActivityStreamsImage returns true if the other provided type is the
// Image type or extends from the Image type.
func IsOrExtendsActivityStreamsImage(other vocab.Type) bool {
return typeimage.IsOrExtendsImage(other)
}
// IsOrExtendsActivityStreamsIntransitiveActivity returns true if the other
// provided type is the IntransitiveActivity type or extends from the
// IntransitiveActivity type.
func IsOrExtendsActivityStreamsIntransitiveActivity(other vocab.Type) bool {
return typeintransitiveactivity.IsOrExtendsIntransitiveActivity(other)
}
// IsOrExtendsActivityStreamsInvite returns true if the other provided type is the
// Invite type or extends from the Invite type.
func IsOrExtendsActivityStreamsInvite(other vocab.Type) bool {
return typeinvite.IsOrExtendsInvite(other)
}
// IsOrExtendsActivityStreamsJoin returns true if the other provided type is the
// Join type or extends from the Join type.
func IsOrExtendsActivityStreamsJoin(other vocab.Type) bool {
return typejoin.IsOrExtendsJoin(other)
}
// IsOrExtendsActivityStreamsLeave returns true if the other provided type is the
// Leave type or extends from the Leave type.
func IsOrExtendsActivityStreamsLeave(other vocab.Type) bool {
return typeleave.IsOrExtendsLeave(other)
}
// IsOrExtendsActivityStreamsLike returns true if the other provided type is the
// Like type or extends from the Like type.
func IsOrExtendsActivityStreamsLike(other vocab.Type) bool {
return typelike.IsOrExtendsLike(other)
}
// IsOrExtendsActivityStreamsLink returns true if the other provided type is the
// Link type or extends from the Link type.
func IsOrExtendsActivityStreamsLink(other vocab.Type) bool {
return typelink.IsOrExtendsLink(other)
}
// IsOrExtendsActivityStreamsListen returns true if the other provided type is the
// Listen type or extends from the Listen type.
func IsOrExtendsActivityStreamsListen(other vocab.Type) bool {
return typelisten.IsOrExtendsListen(other)
}
// IsOrExtendsActivityStreamsMention returns true if the other provided type is
// the Mention type or extends from the Mention type.
func IsOrExtendsActivityStreamsMention(other vocab.Type) bool {
return typemention.IsOrExtendsMention(other)
}
// IsOrExtendsActivityStreamsMove returns true if the other provided type is the
// Move type or extends from the Move type.
func IsOrExtendsActivityStreamsMove(other vocab.Type) bool {
return typemove.IsOrExtendsMove(other)
}
// IsOrExtendsActivityStreamsNote returns true if the other provided type is the
// Note type or extends from the Note type.
func IsOrExtendsActivityStreamsNote(other vocab.Type) bool {
return typenote.IsOrExtendsNote(other)
}
// IsOrExtendsActivityStreamsObject returns true if the other provided type is the
// Object type or extends from the Object type.
func IsOrExtendsActivityStreamsObject(other vocab.Type) bool {
return typeobject.IsOrExtendsObject(other)
}
// IsOrExtendsActivityStreamsOffer returns true if the other provided type is the
// Offer type or extends from the Offer type.
func IsOrExtendsActivityStreamsOffer(other vocab.Type) bool {
return typeoffer.IsOrExtendsOffer(other)
}
// IsOrExtendsActivityStreamsOrderedCollection returns true if the other provided
// type is the OrderedCollection type or extends from the OrderedCollection
// type.
func IsOrExtendsActivityStreamsOrderedCollection(other vocab.Type) bool {
return typeorderedcollection.IsOrExtendsOrderedCollection(other)
}
// IsOrExtendsActivityStreamsOrderedCollectionPage returns true if the other
// provided type is the OrderedCollectionPage type or extends from the
// OrderedCollectionPage type.
func IsOrExtendsActivityStreamsOrderedCollectionPage(other vocab.Type) bool {
return typeorderedcollectionpage.IsOrExtendsOrderedCollectionPage(other)
}
// IsOrExtendsActivityStreamsOrganization returns true if the other provided type
// is the Organization type or extends from the Organization type.
func IsOrExtendsActivityStreamsOrganization(other vocab.Type) bool {
return typeorganization.IsOrExtendsOrganization(other)
}
// IsOrExtendsActivityStreamsPage returns true if the other provided type is the
// Page type or extends from the Page type.
func IsOrExtendsActivityStreamsPage(other vocab.Type) bool {
return typepage.IsOrExtendsPage(other)
}
// IsOrExtendsActivityStreamsPerson returns true if the other provided type is the
// Person type or extends from the Person type.
func IsOrExtendsActivityStreamsPerson(other vocab.Type) bool {
return typeperson.IsOrExtendsPerson(other)
}
// IsOrExtendsActivityStreamsPlace returns true if the other provided type is the
// Place type or extends from the Place type.
func IsOrExtendsActivityStreamsPlace(other vocab.Type) bool {
return typeplace.IsOrExtendsPlace(other)
}
// IsOrExtendsActivityStreamsProfile returns true if the other provided type is
// the Profile type or extends from the Profile type.
func IsOrExtendsActivityStreamsProfile(other vocab.Type) bool {
return typeprofile.IsOrExtendsProfile(other)
}
// IsOrExtendsActivityStreamsQuestion returns true if the other provided type is
// the Question type or extends from the Question type.
func IsOrExtendsActivityStreamsQuestion(other vocab.Type) bool {
return typequestion.IsOrExtendsQuestion(other)
}
// IsOrExtendsActivityStreamsRead returns true if the other provided type is the
// Read type or extends from the Read type.
func IsOrExtendsActivityStreamsRead(other vocab.Type) bool {
return typeread.IsOrExtendsRead(other)
}
// IsOrExtendsActivityStreamsReject returns true if the other provided type is the
// Reject type or extends from the Reject type.
func IsOrExtendsActivityStreamsReject(other vocab.Type) bool {
return typereject.IsOrExtendsReject(other)
}
// IsOrExtendsActivityStreamsRelationship returns true if the other provided type
// is the Relationship type or extends from the Relationship type.
func IsOrExtendsActivityStreamsRelationship(other vocab.Type) bool {
return typerelationship.IsOrExtendsRelationship(other)
}
// IsOrExtendsActivityStreamsRemove returns true if the other provided type is the
// Remove type or extends from the Remove type.
func IsOrExtendsActivityStreamsRemove(other vocab.Type) bool {
return typeremove.IsOrExtendsRemove(other)
}
// IsOrExtendsActivityStreamsService returns true if the other provided type is
// the Service type or extends from the Service type.
func IsOrExtendsActivityStreamsService(other vocab.Type) bool {
return typeservice.IsOrExtendsService(other)
}
// IsOrExtendsActivityStreamsTentativeAccept returns true if the other provided
// type is the TentativeAccept type or extends from the TentativeAccept type.
func IsOrExtendsActivityStreamsTentativeAccept(other vocab.Type) bool {
return typetentativeaccept.IsOrExtendsTentativeAccept(other)
}
// IsOrExtendsActivityStreamsTentativeReject returns true if the other provided
// type is the TentativeReject type or extends from the TentativeReject type.
func IsOrExtendsActivityStreamsTentativeReject(other vocab.Type) bool {
return typetentativereject.IsOrExtendsTentativeReject(other)
}
// IsOrExtendsActivityStreamsTombstone returns true if the other provided type is
// the Tombstone type or extends from the Tombstone type.
func IsOrExtendsActivityStreamsTombstone(other vocab.Type) bool {
return typetombstone.IsOrExtendsTombstone(other)
}
// IsOrExtendsActivityStreamsTravel returns true if the other provided type is the
// Travel type or extends from the Travel type.
func IsOrExtendsActivityStreamsTravel(other vocab.Type) bool {
return typetravel.IsOrExtendsTravel(other)
}
// IsOrExtendsActivityStreamsUndo returns true if the other provided type is the
// Undo type or extends from the Undo type.
func IsOrExtendsActivityStreamsUndo(other vocab.Type) bool {
return typeundo.IsOrExtendsUndo(other)
}
// IsOrExtendsActivityStreamsUpdate returns true if the other provided type is the
// Update type or extends from the Update type.
func IsOrExtendsActivityStreamsUpdate(other vocab.Type) bool {
return typeupdate.IsOrExtendsUpdate(other)
}
// IsOrExtendsActivityStreamsVideo returns true if the other provided type is the
// Video type or extends from the Video type.
func IsOrExtendsActivityStreamsVideo(other vocab.Type) bool {
return typevideo.IsOrExtendsVideo(other)
}
// IsOrExtendsActivityStreamsView returns true if the other provided type is the
// View type or extends from the View type.
func IsOrExtendsActivityStreamsView(other vocab.Type) bool {
return typeview.IsOrExtendsView(other)
}

ファイルの表示

@ -100,7 +100,8 @@ func AcceptIsDisjointWith(other vocab.Type) bool {
} }
// AcceptIsExtendedBy returns true if the other provided type extends from the // AcceptIsExtendedBy returns true if the other provided type extends from the
// Accept type. // Accept type. Note that it returns false if the types are the same; see the
// "IsOrExtendsAccept" variant instead.
func AcceptIsExtendedBy(other vocab.Type) bool { func AcceptIsExtendedBy(other vocab.Type) bool {
extensions := []string{"TentativeAccept"} extensions := []string{"TentativeAccept"}
for _, ext := range extensions { for _, ext := range extensions {
@ -439,6 +440,15 @@ func DeserializeAccept(m map[string]interface{}, aliasMap map[string]string) (*A
return this, nil return this, nil
} }
// IsOrExtendsAccept returns true if the other provided type is the Accept type or
// extends from the Accept type.
func IsOrExtendsAccept(other vocab.Type) bool {
if other.GetTypeName() == "Accept" {
return true
}
return this.AcceptIsExtendedBy(other)
}
// NewActivityStreamsAccept creates a new Accept type // NewActivityStreamsAccept creates a new Accept type
func NewActivityStreamsAccept() *ActivityStreamsAccept { func NewActivityStreamsAccept() *ActivityStreamsAccept {
typeProp := typePropertyConstructor() typeProp := typePropertyConstructor()

ファイルの表示

@ -80,7 +80,8 @@ func ActivityIsDisjointWith(other vocab.Type) bool {
} }
// ActivityIsExtendedBy returns true if the other provided type extends from the // ActivityIsExtendedBy returns true if the other provided type extends from the
// Activity type. // Activity type. Note that it returns false if the types are the same; see
// the "IsOrExtendsActivity" variant instead.
func ActivityIsExtendedBy(other vocab.Type) bool { func ActivityIsExtendedBy(other vocab.Type) bool {
extensions := []string{"Accept", "Add", "Announce", "Arrive", "Block", "Create", "Delete", "Dislike", "Flag", "Follow", "Ignore", "IntransitiveActivity", "Invite", "Join", "Leave", "Like", "Listen", "Move", "Offer", "Question", "Read", "Reject", "Remove", "TentativeAccept", "TentativeReject", "Travel", "Undo", "Update", "View"} extensions := []string{"Accept", "Add", "Announce", "Arrive", "Block", "Create", "Delete", "Dislike", "Flag", "Follow", "Ignore", "IntransitiveActivity", "Invite", "Join", "Leave", "Like", "Listen", "Move", "Offer", "Question", "Read", "Reject", "Remove", "TentativeAccept", "TentativeReject", "Travel", "Undo", "Update", "View"}
for _, ext := range extensions { for _, ext := range extensions {
@ -419,6 +420,15 @@ func DeserializeActivity(m map[string]interface{}, aliasMap map[string]string) (
return this, nil return this, nil
} }
// IsOrExtendsActivity returns true if the other provided type is the Activity
// type or extends from the Activity type.
func IsOrExtendsActivity(other vocab.Type) bool {
if other.GetTypeName() == "Activity" {
return true
}
return this.ActivityIsExtendedBy(other)
}
// NewActivityStreamsActivity creates a new Activity type // NewActivityStreamsActivity creates a new Activity type
func NewActivityStreamsActivity() *ActivityStreamsActivity { func NewActivityStreamsActivity() *ActivityStreamsActivity {
typeProp := typePropertyConstructor() typeProp := typePropertyConstructor()

ファイルの表示

@ -112,7 +112,8 @@ func AddIsDisjointWith(other vocab.Type) bool {
} }
// AddIsExtendedBy returns true if the other provided type extends from the Add // AddIsExtendedBy returns true if the other provided type extends from the Add
// type. // type. Note that it returns false if the types are the same; see the
// "IsOrExtendsAdd" variant instead.
func AddIsExtendedBy(other vocab.Type) bool { func AddIsExtendedBy(other vocab.Type) bool {
// Shortcut implementation: is not extended by anything. // Shortcut implementation: is not extended by anything.
return false return false
@ -434,6 +435,15 @@ func DeserializeAdd(m map[string]interface{}, aliasMap map[string]string) (*Acti
return this, nil return this, nil
} }
// IsOrExtendsAdd returns true if the other provided type is the Add type or
// extends from the Add type.
func IsOrExtendsAdd(other vocab.Type) bool {
if other.GetTypeName() == "Add" {
return true
}
return this.AddIsExtendedBy(other)
}
// NewActivityStreamsAdd creates a new Add type // NewActivityStreamsAdd creates a new Add type
func NewActivityStreamsAdd() *ActivityStreamsAdd { func NewActivityStreamsAdd() *ActivityStreamsAdd {
typeProp := typePropertyConstructor() typeProp := typePropertyConstructor()

ファイルの表示

@ -94,7 +94,8 @@ func AnnounceIsDisjointWith(other vocab.Type) bool {
} }
// AnnounceIsExtendedBy returns true if the other provided type extends from the // AnnounceIsExtendedBy returns true if the other provided type extends from the
// Announce type. // Announce type. Note that it returns false if the types are the same; see
// the "IsOrExtendsAnnounce" variant instead.
func AnnounceIsExtendedBy(other vocab.Type) bool { func AnnounceIsExtendedBy(other vocab.Type) bool {
// Shortcut implementation: is not extended by anything. // Shortcut implementation: is not extended by anything.
return false return false
@ -416,6 +417,15 @@ func DeserializeAnnounce(m map[string]interface{}, aliasMap map[string]string) (
return this, nil return this, nil
} }
// IsOrExtendsAnnounce returns true if the other provided type is the Announce
// type or extends from the Announce type.
func IsOrExtendsAnnounce(other vocab.Type) bool {
if other.GetTypeName() == "Announce" {
return true
}
return this.AnnounceIsExtendedBy(other)
}
// NewActivityStreamsAnnounce creates a new Announce type // NewActivityStreamsAnnounce creates a new Announce type
func NewActivityStreamsAnnounce() *ActivityStreamsAnnounce { func NewActivityStreamsAnnounce() *ActivityStreamsAnnounce {
typeProp := typePropertyConstructor() typeProp := typePropertyConstructor()

ファイルの表示

@ -82,7 +82,8 @@ func ApplicationIsDisjointWith(other vocab.Type) bool {
} }
// ApplicationIsExtendedBy returns true if the other provided type extends from // ApplicationIsExtendedBy returns true if the other provided type extends from
// the Application type. // the Application type. Note that it returns false if the types are the same;
// see the "IsOrExtendsApplication" variant instead.
func ApplicationIsExtendedBy(other vocab.Type) bool { func ApplicationIsExtendedBy(other vocab.Type) bool {
// Shortcut implementation: is not extended by anything. // Shortcut implementation: is not extended by anything.
return false return false
@ -420,6 +421,15 @@ func DeserializeApplication(m map[string]interface{}, aliasMap map[string]string
return this, nil return this, nil
} }
// IsOrExtendsApplication returns true if the other provided type is the
// Application type or extends from the Application type.
func IsOrExtendsApplication(other vocab.Type) bool {
if other.GetTypeName() == "Application" {
return true
}
return this.ApplicationIsExtendedBy(other)
}
// NewActivityStreamsApplication creates a new Application type // NewActivityStreamsApplication creates a new Application type
func NewActivityStreamsApplication() *ActivityStreamsApplication { func NewActivityStreamsApplication() *ActivityStreamsApplication {
typeProp := typePropertyConstructor() typeProp := typePropertyConstructor()

ファイルの表示

@ -93,7 +93,8 @@ func ArriveIsDisjointWith(other vocab.Type) bool {
} }
// ArriveIsExtendedBy returns true if the other provided type extends from the // ArriveIsExtendedBy returns true if the other provided type extends from the
// Arrive type. // Arrive type. Note that it returns false if the types are the same; see the
// "IsOrExtendsArrive" variant instead.
func ArriveIsExtendedBy(other vocab.Type) bool { func ArriveIsExtendedBy(other vocab.Type) bool {
// Shortcut implementation: is not extended by anything. // Shortcut implementation: is not extended by anything.
return false return false
@ -408,6 +409,15 @@ func DeserializeArrive(m map[string]interface{}, aliasMap map[string]string) (*A
return this, nil return this, nil
} }
// IsOrExtendsArrive returns true if the other provided type is the Arrive type or
// extends from the Arrive type.
func IsOrExtendsArrive(other vocab.Type) bool {
if other.GetTypeName() == "Arrive" {
return true
}
return this.ArriveIsExtendedBy(other)
}
// NewActivityStreamsArrive creates a new Arrive type // NewActivityStreamsArrive creates a new Arrive type
func NewActivityStreamsArrive() *ActivityStreamsArrive { func NewActivityStreamsArrive() *ActivityStreamsArrive {
typeProp := typePropertyConstructor() typeProp := typePropertyConstructor()

ファイルの表示

@ -78,7 +78,8 @@ func ArticleIsDisjointWith(other vocab.Type) bool {
} }
// ArticleIsExtendedBy returns true if the other provided type extends from the // ArticleIsExtendedBy returns true if the other provided type extends from the
// Article type. // Article type. Note that it returns false if the types are the same; see the
// "IsOrExtendsArticle" variant instead.
func ArticleIsExtendedBy(other vocab.Type) bool { func ArticleIsExtendedBy(other vocab.Type) bool {
// Shortcut implementation: is not extended by anything. // Shortcut implementation: is not extended by anything.
return false return false
@ -365,6 +366,15 @@ func DeserializeArticle(m map[string]interface{}, aliasMap map[string]string) (*
return this, nil return this, nil
} }
// IsOrExtendsArticle returns true if the other provided type is the Article type
// or extends from the Article type.
func IsOrExtendsArticle(other vocab.Type) bool {
if other.GetTypeName() == "Article" {
return true
}
return this.ArticleIsExtendedBy(other)
}
// NewActivityStreamsArticle creates a new Article type // NewActivityStreamsArticle creates a new Article type
func NewActivityStreamsArticle() *ActivityStreamsArticle { func NewActivityStreamsArticle() *ActivityStreamsArticle {
typeProp := typePropertyConstructor() typeProp := typePropertyConstructor()

ファイルの表示

@ -80,7 +80,8 @@ func AudioIsDisjointWith(other vocab.Type) bool {
} }
// AudioIsExtendedBy returns true if the other provided type extends from the // AudioIsExtendedBy returns true if the other provided type extends from the
// Audio type. // Audio type. Note that it returns false if the types are the same; see the
// "IsOrExtendsAudio" variant instead.
func AudioIsExtendedBy(other vocab.Type) bool { func AudioIsExtendedBy(other vocab.Type) bool {
// Shortcut implementation: is not extended by anything. // Shortcut implementation: is not extended by anything.
return false return false
@ -367,6 +368,15 @@ func DeserializeAudio(m map[string]interface{}, aliasMap map[string]string) (*Ac
return this, nil return this, nil
} }
// IsOrExtendsAudio returns true if the other provided type is the Audio type or
// extends from the Audio type.
func IsOrExtendsAudio(other vocab.Type) bool {
if other.GetTypeName() == "Audio" {
return true
}
return this.AudioIsExtendedBy(other)
}
// NewActivityStreamsAudio creates a new Audio type // NewActivityStreamsAudio creates a new Audio type
func NewActivityStreamsAudio() *ActivityStreamsAudio { func NewActivityStreamsAudio() *ActivityStreamsAudio {
typeProp := typePropertyConstructor() typeProp := typePropertyConstructor()

ファイルの表示

@ -85,7 +85,8 @@ func BlockIsDisjointWith(other vocab.Type) bool {
} }
// BlockIsExtendedBy returns true if the other provided type extends from the // BlockIsExtendedBy returns true if the other provided type extends from the
// Block type. // Block type. Note that it returns false if the types are the same; see the
// "IsOrExtendsBlock" variant instead.
func BlockIsExtendedBy(other vocab.Type) bool { func BlockIsExtendedBy(other vocab.Type) bool {
// Shortcut implementation: is not extended by anything. // Shortcut implementation: is not extended by anything.
return false return false
@ -407,6 +408,15 @@ func DeserializeBlock(m map[string]interface{}, aliasMap map[string]string) (*Ac
return this, nil return this, nil
} }
// IsOrExtendsBlock returns true if the other provided type is the Block type or
// extends from the Block type.
func IsOrExtendsBlock(other vocab.Type) bool {
if other.GetTypeName() == "Block" {
return true
}
return this.BlockIsExtendedBy(other)
}
// NewActivityStreamsBlock creates a new Block type // NewActivityStreamsBlock creates a new Block type
func NewActivityStreamsBlock() *ActivityStreamsBlock { func NewActivityStreamsBlock() *ActivityStreamsBlock {
typeProp := typePropertyConstructor() typeProp := typePropertyConstructor()

ファイルの表示

@ -93,7 +93,8 @@ func CollectionIsDisjointWith(other vocab.Type) bool {
} }
// CollectionIsExtendedBy returns true if the other provided type extends from the // CollectionIsExtendedBy returns true if the other provided type extends from the
// Collection type. // Collection type. Note that it returns false if the types are the same; see
// the "IsOrExtendsCollection" variant instead.
func CollectionIsExtendedBy(other vocab.Type) bool { func CollectionIsExtendedBy(other vocab.Type) bool {
extensions := []string{"CollectionPage", "OrderedCollection", "OrderedCollectionPage", "OrderedCollectionPage"} extensions := []string{"CollectionPage", "OrderedCollection", "OrderedCollectionPage", "OrderedCollectionPage"}
for _, ext := range extensions { for _, ext := range extensions {
@ -420,6 +421,15 @@ func DeserializeCollection(m map[string]interface{}, aliasMap map[string]string)
return this, nil return this, nil
} }
// IsOrExtendsCollection returns true if the other provided type is the Collection
// type or extends from the Collection type.
func IsOrExtendsCollection(other vocab.Type) bool {
if other.GetTypeName() == "Collection" {
return true
}
return this.CollectionIsExtendedBy(other)
}
// NewActivityStreamsCollection creates a new Collection type // NewActivityStreamsCollection creates a new Collection type
func NewActivityStreamsCollection() *ActivityStreamsCollection { func NewActivityStreamsCollection() *ActivityStreamsCollection {
typeProp := typePropertyConstructor() typeProp := typePropertyConstructor()

ファイルの表示

@ -97,7 +97,8 @@ func CollectionPageIsDisjointWith(other vocab.Type) bool {
} }
// CollectionPageIsExtendedBy returns true if the other provided type extends from // CollectionPageIsExtendedBy returns true if the other provided type extends from
// the CollectionPage type. // the CollectionPage type. Note that it returns false if the types are the
// same; see the "IsOrExtendsCollectionPage" variant instead.
func CollectionPageIsExtendedBy(other vocab.Type) bool { func CollectionPageIsExtendedBy(other vocab.Type) bool {
extensions := []string{"OrderedCollectionPage"} extensions := []string{"OrderedCollectionPage"}
for _, ext := range extensions { for _, ext := range extensions {
@ -445,6 +446,15 @@ func DeserializeCollectionPage(m map[string]interface{}, aliasMap map[string]str
return this, nil return this, nil
} }
// IsOrExtendsCollectionPage returns true if the other provided type is the
// CollectionPage type or extends from the CollectionPage type.
func IsOrExtendsCollectionPage(other vocab.Type) bool {
if other.GetTypeName() == "CollectionPage" {
return true
}
return this.CollectionPageIsExtendedBy(other)
}
// NewActivityStreamsCollectionPage creates a new CollectionPage type // NewActivityStreamsCollectionPage creates a new CollectionPage type
func NewActivityStreamsCollectionPage() *ActivityStreamsCollectionPage { func NewActivityStreamsCollectionPage() *ActivityStreamsCollectionPage {
typeProp := typePropertyConstructor() typeProp := typePropertyConstructor()

ファイルの表示

@ -89,7 +89,8 @@ func CreateIsDisjointWith(other vocab.Type) bool {
} }
// CreateIsExtendedBy returns true if the other provided type extends from the // CreateIsExtendedBy returns true if the other provided type extends from the
// Create type. // Create type. Note that it returns false if the types are the same; see the
// "IsOrExtendsCreate" variant instead.
func CreateIsExtendedBy(other vocab.Type) bool { func CreateIsExtendedBy(other vocab.Type) bool {
// Shortcut implementation: is not extended by anything. // Shortcut implementation: is not extended by anything.
return false return false
@ -411,6 +412,15 @@ func DeserializeCreate(m map[string]interface{}, aliasMap map[string]string) (*A
return this, nil return this, nil
} }
// IsOrExtendsCreate returns true if the other provided type is the Create type or
// extends from the Create type.
func IsOrExtendsCreate(other vocab.Type) bool {
if other.GetTypeName() == "Create" {
return true
}
return this.CreateIsExtendedBy(other)
}
// NewActivityStreamsCreate creates a new Create type // NewActivityStreamsCreate creates a new Create type
func NewActivityStreamsCreate() *ActivityStreamsCreate { func NewActivityStreamsCreate() *ActivityStreamsCreate {
typeProp := typePropertyConstructor() typeProp := typePropertyConstructor()

ファイルの表示

@ -90,7 +90,8 @@ func DeleteIsDisjointWith(other vocab.Type) bool {
} }
// DeleteIsExtendedBy returns true if the other provided type extends from the // DeleteIsExtendedBy returns true if the other provided type extends from the
// Delete type. // Delete type. Note that it returns false if the types are the same; see the
// "IsOrExtendsDelete" variant instead.
func DeleteIsExtendedBy(other vocab.Type) bool { func DeleteIsExtendedBy(other vocab.Type) bool {
// Shortcut implementation: is not extended by anything. // Shortcut implementation: is not extended by anything.
return false return false
@ -412,6 +413,15 @@ func DeserializeDelete(m map[string]interface{}, aliasMap map[string]string) (*A
return this, nil return this, nil
} }
// IsOrExtendsDelete returns true if the other provided type is the Delete type or
// extends from the Delete type.
func IsOrExtendsDelete(other vocab.Type) bool {
if other.GetTypeName() == "Delete" {
return true
}
return this.DeleteIsExtendedBy(other)
}
// NewActivityStreamsDelete creates a new Delete type // NewActivityStreamsDelete creates a new Delete type
func NewActivityStreamsDelete() *ActivityStreamsDelete { func NewActivityStreamsDelete() *ActivityStreamsDelete {
typeProp := typePropertyConstructor() typeProp := typePropertyConstructor()

ファイルの表示

@ -398,12 +398,22 @@ func DislikeIsDisjointWith(other vocab.Type) bool {
} }
// DislikeIsExtendedBy returns true if the other provided type extends from the // DislikeIsExtendedBy returns true if the other provided type extends from the
// Dislike type. // Dislike type. Note that it returns false if the types are the same; see the
// "IsOrExtendsDislike" variant instead.
func DislikeIsExtendedBy(other vocab.Type) bool { func DislikeIsExtendedBy(other vocab.Type) bool {
// Shortcut implementation: is not extended by anything. // Shortcut implementation: is not extended by anything.
return false return false
} }
// IsOrExtendsDislike returns true if the other provided type is the Dislike type
// or extends from the Dislike type.
func IsOrExtendsDislike(other vocab.Type) bool {
if other.GetTypeName() == "Dislike" {
return true
}
return this.DislikeIsExtendedBy(other)
}
// NewActivityStreamsDislike creates a new Dislike type // NewActivityStreamsDislike creates a new Dislike type
func NewActivityStreamsDislike() *ActivityStreamsDislike { func NewActivityStreamsDislike() *ActivityStreamsDislike {
typeProp := typePropertyConstructor() typeProp := typePropertyConstructor()

ファイルの表示

@ -357,7 +357,8 @@ func DocumentIsDisjointWith(other vocab.Type) bool {
} }
// DocumentIsExtendedBy returns true if the other provided type extends from the // DocumentIsExtendedBy returns true if the other provided type extends from the
// Document type. // Document type. Note that it returns false if the types are the same; see
// the "IsOrExtendsDocument" variant instead.
func DocumentIsExtendedBy(other vocab.Type) bool { func DocumentIsExtendedBy(other vocab.Type) bool {
extensions := []string{"Audio", "Image", "Page", "Video"} extensions := []string{"Audio", "Image", "Page", "Video"}
for _, ext := range extensions { for _, ext := range extensions {
@ -368,6 +369,15 @@ func DocumentIsExtendedBy(other vocab.Type) bool {
return false return false
} }
// IsOrExtendsDocument returns true if the other provided type is the Document
// type or extends from the Document type.
func IsOrExtendsDocument(other vocab.Type) bool {
if other.GetTypeName() == "Document" {
return true
}
return this.DocumentIsExtendedBy(other)
}
// NewActivityStreamsDocument creates a new Document type // NewActivityStreamsDocument creates a new Document type
func NewActivityStreamsDocument() *ActivityStreamsDocument { func NewActivityStreamsDocument() *ActivityStreamsDocument {
typeProp := typePropertyConstructor() typeProp := typePropertyConstructor()

ファイルの表示

@ -358,12 +358,22 @@ func EventIsDisjointWith(other vocab.Type) bool {
} }
// EventIsExtendedBy returns true if the other provided type extends from the // EventIsExtendedBy returns true if the other provided type extends from the
// Event type. // Event type. Note that it returns false if the types are the same; see the
// "IsOrExtendsEvent" variant instead.
func EventIsExtendedBy(other vocab.Type) bool { func EventIsExtendedBy(other vocab.Type) bool {
// Shortcut implementation: is not extended by anything. // Shortcut implementation: is not extended by anything.
return false return false
} }
// IsOrExtendsEvent returns true if the other provided type is the Event type or
// extends from the Event type.
func IsOrExtendsEvent(other vocab.Type) bool {
if other.GetTypeName() == "Event" {
return true
}
return this.EventIsExtendedBy(other)
}
// NewActivityStreamsEvent creates a new Event type // NewActivityStreamsEvent creates a new Event type
func NewActivityStreamsEvent() *ActivityStreamsEvent { func NewActivityStreamsEvent() *ActivityStreamsEvent {
typeProp := typePropertyConstructor() typeProp := typePropertyConstructor()

ファイルの表示

@ -403,12 +403,22 @@ func FlagIsDisjointWith(other vocab.Type) bool {
} }
// FlagIsExtendedBy returns true if the other provided type extends from the Flag // FlagIsExtendedBy returns true if the other provided type extends from the Flag
// type. // type. Note that it returns false if the types are the same; see the
// "IsOrExtendsFlag" variant instead.
func FlagIsExtendedBy(other vocab.Type) bool { func FlagIsExtendedBy(other vocab.Type) bool {
// Shortcut implementation: is not extended by anything. // Shortcut implementation: is not extended by anything.
return false return false
} }
// IsOrExtendsFlag returns true if the other provided type is the Flag type or
// extends from the Flag type.
func IsOrExtendsFlag(other vocab.Type) bool {
if other.GetTypeName() == "Flag" {
return true
}
return this.FlagIsExtendedBy(other)
}
// NewActivityStreamsFlag creates a new Flag type // NewActivityStreamsFlag creates a new Flag type
func NewActivityStreamsFlag() *ActivityStreamsFlag { func NewActivityStreamsFlag() *ActivityStreamsFlag {
typeProp := typePropertyConstructor() typeProp := typePropertyConstructor()

ファイルの表示

@ -407,12 +407,22 @@ func FollowIsDisjointWith(other vocab.Type) bool {
} }
// FollowIsExtendedBy returns true if the other provided type extends from the // FollowIsExtendedBy returns true if the other provided type extends from the
// Follow type. // Follow type. Note that it returns false if the types are the same; see the
// "IsOrExtendsFollow" variant instead.
func FollowIsExtendedBy(other vocab.Type) bool { func FollowIsExtendedBy(other vocab.Type) bool {
// Shortcut implementation: is not extended by anything. // Shortcut implementation: is not extended by anything.
return false return false
} }
// IsOrExtendsFollow returns true if the other provided type is the Follow type or
// extends from the Follow type.
func IsOrExtendsFollow(other vocab.Type) bool {
if other.GetTypeName() == "Follow" {
return true
}
return this.FollowIsExtendedBy(other)
}
// NewActivityStreamsFollow creates a new Follow type // NewActivityStreamsFollow creates a new Follow type
func NewActivityStreamsFollow() *ActivityStreamsFollow { func NewActivityStreamsFollow() *ActivityStreamsFollow {
typeProp := typePropertyConstructor() typeProp := typePropertyConstructor()

ファイルの表示

@ -414,12 +414,22 @@ func GroupIsDisjointWith(other vocab.Type) bool {
} }
// GroupIsExtendedBy returns true if the other provided type extends from the // GroupIsExtendedBy returns true if the other provided type extends from the
// Group type. // Group type. Note that it returns false if the types are the same; see the
// "IsOrExtendsGroup" variant instead.
func GroupIsExtendedBy(other vocab.Type) bool { func GroupIsExtendedBy(other vocab.Type) bool {
// Shortcut implementation: is not extended by anything. // Shortcut implementation: is not extended by anything.
return false return false
} }
// IsOrExtendsGroup returns true if the other provided type is the Group type or
// extends from the Group type.
func IsOrExtendsGroup(other vocab.Type) bool {
if other.GetTypeName() == "Group" {
return true
}
return this.GroupIsExtendedBy(other)
}
// NewActivityStreamsGroup creates a new Group type // NewActivityStreamsGroup creates a new Group type
func NewActivityStreamsGroup() *ActivityStreamsGroup { func NewActivityStreamsGroup() *ActivityStreamsGroup {
typeProp := typePropertyConstructor() typeProp := typePropertyConstructor()

ファイルの表示

@ -402,7 +402,8 @@ func IgnoreIsDisjointWith(other vocab.Type) bool {
} }
// IgnoreIsExtendedBy returns true if the other provided type extends from the // IgnoreIsExtendedBy returns true if the other provided type extends from the
// Ignore type. // Ignore type. Note that it returns false if the types are the same; see the
// "IsOrExtendsIgnore" variant instead.
func IgnoreIsExtendedBy(other vocab.Type) bool { func IgnoreIsExtendedBy(other vocab.Type) bool {
extensions := []string{"Block"} extensions := []string{"Block"}
for _, ext := range extensions { for _, ext := range extensions {
@ -413,6 +414,15 @@ func IgnoreIsExtendedBy(other vocab.Type) bool {
return false return false
} }
// IsOrExtendsIgnore returns true if the other provided type is the Ignore type or
// extends from the Ignore type.
func IsOrExtendsIgnore(other vocab.Type) bool {
if other.GetTypeName() == "Ignore" {
return true
}
return this.IgnoreIsExtendedBy(other)
}
// NewActivityStreamsIgnore creates a new Ignore type // NewActivityStreamsIgnore creates a new Ignore type
func NewActivityStreamsIgnore() *ActivityStreamsIgnore { func NewActivityStreamsIgnore() *ActivityStreamsIgnore {
typeProp := typePropertyConstructor() typeProp := typePropertyConstructor()

ファイルの表示

@ -384,12 +384,22 @@ func ImageIsDisjointWith(other vocab.Type) bool {
} }
// ImageIsExtendedBy returns true if the other provided type extends from the // ImageIsExtendedBy returns true if the other provided type extends from the
// Image type. // Image type. Note that it returns false if the types are the same; see the
// "IsOrExtendsImage" variant instead.
func ImageIsExtendedBy(other vocab.Type) bool { func ImageIsExtendedBy(other vocab.Type) bool {
// Shortcut implementation: is not extended by anything. // Shortcut implementation: is not extended by anything.
return false return false
} }
// IsOrExtendsImage returns true if the other provided type is the Image type or
// extends from the Image type.
func IsOrExtendsImage(other vocab.Type) bool {
if other.GetTypeName() == "Image" {
return true
}
return this.ImageIsExtendedBy(other)
}
// NewActivityStreamsImage creates a new Image type // NewActivityStreamsImage creates a new Image type
func NewActivityStreamsImage() *ActivityStreamsImage { func NewActivityStreamsImage() *ActivityStreamsImage {
typeProp := typePropertyConstructor() typeProp := typePropertyConstructor()

ファイルの表示

@ -398,7 +398,9 @@ func IntransitiveActivityIsDisjointWith(other vocab.Type) bool {
} }
// IntransitiveActivityIsExtendedBy returns true if the other provided type // IntransitiveActivityIsExtendedBy returns true if the other provided type
// extends from the IntransitiveActivity type. // extends from the IntransitiveActivity type. Note that it returns false if
// the types are the same; see the "IsOrExtendsIntransitiveActivity" variant
// instead.
func IntransitiveActivityIsExtendedBy(other vocab.Type) bool { func IntransitiveActivityIsExtendedBy(other vocab.Type) bool {
extensions := []string{"Arrive", "Question", "Travel"} extensions := []string{"Arrive", "Question", "Travel"}
for _, ext := range extensions { for _, ext := range extensions {
@ -409,6 +411,15 @@ func IntransitiveActivityIsExtendedBy(other vocab.Type) bool {
return false return false
} }
// IsOrExtendsIntransitiveActivity returns true if the other provided type is the
// IntransitiveActivity type or extends from the IntransitiveActivity type.
func IsOrExtendsIntransitiveActivity(other vocab.Type) bool {
if other.GetTypeName() == "IntransitiveActivity" {
return true
}
return this.IntransitiveActivityIsExtendedBy(other)
}
// NewActivityStreamsIntransitiveActivity creates a new IntransitiveActivity type // NewActivityStreamsIntransitiveActivity creates a new IntransitiveActivity type
func NewActivityStreamsIntransitiveActivity() *ActivityStreamsIntransitiveActivity { func NewActivityStreamsIntransitiveActivity() *ActivityStreamsIntransitiveActivity {
typeProp := typePropertyConstructor() typeProp := typePropertyConstructor()

ファイルの表示

@ -415,12 +415,22 @@ func InviteIsDisjointWith(other vocab.Type) bool {
} }
// InviteIsExtendedBy returns true if the other provided type extends from the // InviteIsExtendedBy returns true if the other provided type extends from the
// Invite type. // Invite type. Note that it returns false if the types are the same; see the
// "IsOrExtendsInvite" variant instead.
func InviteIsExtendedBy(other vocab.Type) bool { func InviteIsExtendedBy(other vocab.Type) bool {
// Shortcut implementation: is not extended by anything. // Shortcut implementation: is not extended by anything.
return false return false
} }
// IsOrExtendsInvite returns true if the other provided type is the Invite type or
// extends from the Invite type.
func IsOrExtendsInvite(other vocab.Type) bool {
if other.GetTypeName() == "Invite" {
return true
}
return this.InviteIsExtendedBy(other)
}
// NewActivityStreamsInvite creates a new Invite type // NewActivityStreamsInvite creates a new Invite type
func NewActivityStreamsInvite() *ActivityStreamsInvite { func NewActivityStreamsInvite() *ActivityStreamsInvite {
typeProp := typePropertyConstructor() typeProp := typePropertyConstructor()

ファイルの表示

@ -392,6 +392,15 @@ func DeserializeJoin(m map[string]interface{}, aliasMap map[string]string) (*Act
return this, nil return this, nil
} }
// IsOrExtendsJoin returns true if the other provided type is the Join type or
// extends from the Join type.
func IsOrExtendsJoin(other vocab.Type) bool {
if other.GetTypeName() == "Join" {
return true
}
return this.JoinIsExtendedBy(other)
}
// JoinIsDisjointWith returns true if the other provided type is disjoint with the // JoinIsDisjointWith returns true if the other provided type is disjoint with the
// Join type. // Join type.
func JoinIsDisjointWith(other vocab.Type) bool { func JoinIsDisjointWith(other vocab.Type) bool {
@ -405,7 +414,8 @@ func JoinIsDisjointWith(other vocab.Type) bool {
} }
// JoinIsExtendedBy returns true if the other provided type extends from the Join // JoinIsExtendedBy returns true if the other provided type extends from the Join
// type. // type. Note that it returns false if the types are the same; see the
// "IsOrExtendsJoin" variant instead.
func JoinIsExtendedBy(other vocab.Type) bool { func JoinIsExtendedBy(other vocab.Type) bool {
// Shortcut implementation: is not extended by anything. // Shortcut implementation: is not extended by anything.
return false return false

ファイルの表示

@ -406,6 +406,15 @@ func DeserializeLeave(m map[string]interface{}, aliasMap map[string]string) (*Ac
return this, nil return this, nil
} }
// IsOrExtendsLeave returns true if the other provided type is the Leave type or
// extends from the Leave type.
func IsOrExtendsLeave(other vocab.Type) bool {
if other.GetTypeName() == "Leave" {
return true
}
return this.LeaveIsExtendedBy(other)
}
// LeaveIsDisjointWith returns true if the other provided type is disjoint with // LeaveIsDisjointWith returns true if the other provided type is disjoint with
// the Leave type. // the Leave type.
func LeaveIsDisjointWith(other vocab.Type) bool { func LeaveIsDisjointWith(other vocab.Type) bool {
@ -419,7 +428,8 @@ func LeaveIsDisjointWith(other vocab.Type) bool {
} }
// LeaveIsExtendedBy returns true if the other provided type extends from the // LeaveIsExtendedBy returns true if the other provided type extends from the
// Leave type. // Leave type. Note that it returns false if the types are the same; see the
// "IsOrExtendsLeave" variant instead.
func LeaveIsExtendedBy(other vocab.Type) bool { func LeaveIsExtendedBy(other vocab.Type) bool {
// Shortcut implementation: is not extended by anything. // Shortcut implementation: is not extended by anything.
return false return false

ファイルの表示

@ -389,6 +389,15 @@ func DeserializeLike(m map[string]interface{}, aliasMap map[string]string) (*Act
return this, nil return this, nil
} }
// IsOrExtendsLike returns true if the other provided type is the Like type or
// extends from the Like type.
func IsOrExtendsLike(other vocab.Type) bool {
if other.GetTypeName() == "Like" {
return true
}
return this.LikeIsExtendedBy(other)
}
// LikeIsDisjointWith returns true if the other provided type is disjoint with the // LikeIsDisjointWith returns true if the other provided type is disjoint with the
// Like type. // Like type.
func LikeIsDisjointWith(other vocab.Type) bool { func LikeIsDisjointWith(other vocab.Type) bool {
@ -402,7 +411,8 @@ func LikeIsDisjointWith(other vocab.Type) bool {
} }
// LikeIsExtendedBy returns true if the other provided type extends from the Like // LikeIsExtendedBy returns true if the other provided type extends from the Like
// type. // type. Note that it returns false if the types are the same; see the
// "IsOrExtendsLike" variant instead.
func LikeIsExtendedBy(other vocab.Type) bool { func LikeIsExtendedBy(other vocab.Type) bool {
// Shortcut implementation: is not extended by anything. // Shortcut implementation: is not extended by anything.
return false return false

ファイルの表示

@ -185,6 +185,15 @@ func DeserializeLink(m map[string]interface{}, aliasMap map[string]string) (*Act
return this, nil return this, nil
} }
// IsOrExtendsLink returns true if the other provided type is the Link type or
// extends from the Link type.
func IsOrExtendsLink(other vocab.Type) bool {
if other.GetTypeName() == "Link" {
return true
}
return this.LinkIsExtendedBy(other)
}
// LinkIsDisjointWith returns true if the other provided type is disjoint with the // LinkIsDisjointWith returns true if the other provided type is disjoint with the
// Link type. // Link type.
func LinkIsDisjointWith(other vocab.Type) bool { func LinkIsDisjointWith(other vocab.Type) bool {
@ -198,7 +207,8 @@ func LinkIsDisjointWith(other vocab.Type) bool {
} }
// LinkIsExtendedBy returns true if the other provided type extends from the Link // LinkIsExtendedBy returns true if the other provided type extends from the Link
// type. // type. Note that it returns false if the types are the same; see the
// "IsOrExtendsLink" variant instead.
func LinkIsExtendedBy(other vocab.Type) bool { func LinkIsExtendedBy(other vocab.Type) bool {
extensions := []string{"Mention"} extensions := []string{"Mention"}
for _, ext := range extensions { for _, ext := range extensions {

ファイルの表示

@ -388,6 +388,15 @@ func DeserializeListen(m map[string]interface{}, aliasMap map[string]string) (*A
return this, nil return this, nil
} }
// IsOrExtendsListen returns true if the other provided type is the Listen type or
// extends from the Listen type.
func IsOrExtendsListen(other vocab.Type) bool {
if other.GetTypeName() == "Listen" {
return true
}
return this.ListenIsExtendedBy(other)
}
// ListenIsDisjointWith returns true if the other provided type is disjoint with // ListenIsDisjointWith returns true if the other provided type is disjoint with
// the Listen type. // the Listen type.
func ListenIsDisjointWith(other vocab.Type) bool { func ListenIsDisjointWith(other vocab.Type) bool {
@ -401,7 +410,8 @@ func ListenIsDisjointWith(other vocab.Type) bool {
} }
// ListenIsExtendedBy returns true if the other provided type extends from the // ListenIsExtendedBy returns true if the other provided type extends from the
// Listen type. // Listen type. Note that it returns false if the types are the same; see the
// "IsOrExtendsListen" variant instead.
func ListenIsExtendedBy(other vocab.Type) bool { func ListenIsExtendedBy(other vocab.Type) bool {
// Shortcut implementation: is not extended by anything. // Shortcut implementation: is not extended by anything.
return false return false

ファイルの表示

@ -183,6 +183,15 @@ func DeserializeMention(m map[string]interface{}, aliasMap map[string]string) (*
return this, nil return this, nil
} }
// IsOrExtendsMention returns true if the other provided type is the Mention type
// or extends from the Mention type.
func IsOrExtendsMention(other vocab.Type) bool {
if other.GetTypeName() == "Mention" {
return true
}
return this.MentionIsExtendedBy(other)
}
// MentionIsDisjointWith returns true if the other provided type is disjoint with // MentionIsDisjointWith returns true if the other provided type is disjoint with
// the Mention type. // the Mention type.
func MentionIsDisjointWith(other vocab.Type) bool { func MentionIsDisjointWith(other vocab.Type) bool {
@ -196,7 +205,8 @@ func MentionIsDisjointWith(other vocab.Type) bool {
} }
// MentionIsExtendedBy returns true if the other provided type extends from the // MentionIsExtendedBy returns true if the other provided type extends from the
// Mention type. // Mention type. Note that it returns false if the types are the same; see the
// "IsOrExtendsMention" variant instead.
func MentionIsExtendedBy(other vocab.Type) bool { func MentionIsExtendedBy(other vocab.Type) bool {
// Shortcut implementation: is not extended by anything. // Shortcut implementation: is not extended by anything.
return false return false

ファイルの表示

@ -397,6 +397,15 @@ func DeserializeMove(m map[string]interface{}, aliasMap map[string]string) (*Act
return this, nil return this, nil
} }
// IsOrExtendsMove returns true if the other provided type is the Move type or
// extends from the Move type.
func IsOrExtendsMove(other vocab.Type) bool {
if other.GetTypeName() == "Move" {
return true
}
return this.MoveIsExtendedBy(other)
}
// MoveIsDisjointWith returns true if the other provided type is disjoint with the // MoveIsDisjointWith returns true if the other provided type is disjoint with the
// Move type. // Move type.
func MoveIsDisjointWith(other vocab.Type) bool { func MoveIsDisjointWith(other vocab.Type) bool {
@ -410,7 +419,8 @@ func MoveIsDisjointWith(other vocab.Type) bool {
} }
// MoveIsExtendedBy returns true if the other provided type extends from the Move // MoveIsExtendedBy returns true if the other provided type extends from the Move
// type. // type. Note that it returns false if the types are the same; see the
// "IsOrExtendsMove" variant instead.
func MoveIsExtendedBy(other vocab.Type) bool { func MoveIsExtendedBy(other vocab.Type) bool {
// Shortcut implementation: is not extended by anything. // Shortcut implementation: is not extended by anything.
return false return false

ファイルの表示

@ -345,6 +345,15 @@ func DeserializeNote(m map[string]interface{}, aliasMap map[string]string) (*Act
return this, nil return this, nil
} }
// IsOrExtendsNote returns true if the other provided type is the Note type or
// extends from the Note type.
func IsOrExtendsNote(other vocab.Type) bool {
if other.GetTypeName() == "Note" {
return true
}
return this.NoteIsExtendedBy(other)
}
// NewActivityStreamsNote creates a new Note type // NewActivityStreamsNote creates a new Note type
func NewActivityStreamsNote() *ActivityStreamsNote { func NewActivityStreamsNote() *ActivityStreamsNote {
typeProp := typePropertyConstructor() typeProp := typePropertyConstructor()
@ -369,7 +378,8 @@ func NoteIsDisjointWith(other vocab.Type) bool {
} }
// NoteIsExtendedBy returns true if the other provided type extends from the Note // NoteIsExtendedBy returns true if the other provided type extends from the Note
// type. // type. Note that it returns false if the types are the same; see the
// "IsOrExtendsNote" variant instead.
func NoteIsExtendedBy(other vocab.Type) bool { func NoteIsExtendedBy(other vocab.Type) bool {
// Shortcut implementation: is not extended by anything. // Shortcut implementation: is not extended by anything.
return false return false

ファイルの表示

@ -342,6 +342,15 @@ func DeserializeObject(m map[string]interface{}, aliasMap map[string]string) (*A
return this, nil return this, nil
} }
// IsOrExtendsObject returns true if the other provided type is the Object type or
// extends from the Object type.
func IsOrExtendsObject(other vocab.Type) bool {
if other.GetTypeName() == "Object" {
return true
}
return this.ObjectIsExtendedBy(other)
}
// NewActivityStreamsObject creates a new Object type // NewActivityStreamsObject creates a new Object type
func NewActivityStreamsObject() *ActivityStreamsObject { func NewActivityStreamsObject() *ActivityStreamsObject {
typeProp := typePropertyConstructor() typeProp := typePropertyConstructor()
@ -366,7 +375,8 @@ func ObjectIsDisjointWith(other vocab.Type) bool {
} }
// ObjectIsExtendedBy returns true if the other provided type extends from the // ObjectIsExtendedBy returns true if the other provided type extends from the
// Object type. // Object type. Note that it returns false if the types are the same; see the
// "IsOrExtendsObject" variant instead.
func ObjectIsExtendedBy(other vocab.Type) bool { func ObjectIsExtendedBy(other vocab.Type) bool {
extensions := []string{"Accept", "Activity", "Add", "Announce", "Application", "Arrive", "Article", "Audio", "Block", "Collection", "CollectionPage", "Create", "Delete", "Dislike", "Document", "Event", "Flag", "Follow", "Group", "Ignore", "Image", "IntransitiveActivity", "Invite", "Join", "Leave", "Like", "Listen", "Move", "Note", "Offer", "OrderedCollection", "OrderedCollectionPage", "OrderedCollectionPage", "Organization", "Page", "Person", "Place", "Profile", "Question", "Read", "Reject", "Relationship", "Remove", "Service", "TentativeAccept", "TentativeReject", "Tombstone", "Travel", "Undo", "Update", "Video", "View"} extensions := []string{"Accept", "Activity", "Add", "Announce", "Application", "Arrive", "Article", "Audio", "Block", "Collection", "CollectionPage", "Create", "Delete", "Dislike", "Document", "Event", "Flag", "Follow", "Group", "Ignore", "Image", "IntransitiveActivity", "Invite", "Join", "Leave", "Like", "Listen", "Move", "Note", "Offer", "OrderedCollection", "OrderedCollectionPage", "OrderedCollectionPage", "Organization", "Page", "Person", "Place", "Profile", "Question", "Read", "Reject", "Relationship", "Remove", "Service", "TentativeAccept", "TentativeReject", "Tombstone", "Travel", "Undo", "Update", "Video", "View"}
for _, ext := range extensions { for _, ext := range extensions {

ファイルの表示

@ -396,6 +396,15 @@ func DeserializeOffer(m map[string]interface{}, aliasMap map[string]string) (*Ac
return this, nil return this, nil
} }
// IsOrExtendsOffer returns true if the other provided type is the Offer type or
// extends from the Offer type.
func IsOrExtendsOffer(other vocab.Type) bool {
if other.GetTypeName() == "Offer" {
return true
}
return this.OfferIsExtendedBy(other)
}
// NewActivityStreamsOffer creates a new Offer type // NewActivityStreamsOffer creates a new Offer type
func NewActivityStreamsOffer() *ActivityStreamsOffer { func NewActivityStreamsOffer() *ActivityStreamsOffer {
typeProp := typePropertyConstructor() typeProp := typePropertyConstructor()
@ -420,7 +429,8 @@ func OfferIsDisjointWith(other vocab.Type) bool {
} }
// OfferIsExtendedBy returns true if the other provided type extends from the // OfferIsExtendedBy returns true if the other provided type extends from the
// Offer type. // Offer type. Note that it returns false if the types are the same; see the
// "IsOrExtendsOffer" variant instead.
func OfferIsExtendedBy(other vocab.Type) bool { func OfferIsExtendedBy(other vocab.Type) bool {
extensions := []string{"Invite"} extensions := []string{"Invite"}
for _, ext := range extensions { for _, ext := range extensions {

ファイルの表示

@ -395,6 +395,15 @@ func DeserializeOrderedCollection(m map[string]interface{}, aliasMap map[string]
return this, nil return this, nil
} }
// IsOrExtendsOrderedCollection returns true if the other provided type is the
// OrderedCollection type or extends from the OrderedCollection type.
func IsOrExtendsOrderedCollection(other vocab.Type) bool {
if other.GetTypeName() == "OrderedCollection" {
return true
}
return this.OrderedCollectionIsExtendedBy(other)
}
// NewActivityStreamsOrderedCollection creates a new OrderedCollection type // NewActivityStreamsOrderedCollection creates a new OrderedCollection type
func NewActivityStreamsOrderedCollection() *ActivityStreamsOrderedCollection { func NewActivityStreamsOrderedCollection() *ActivityStreamsOrderedCollection {
typeProp := typePropertyConstructor() typeProp := typePropertyConstructor()
@ -419,7 +428,8 @@ func OrderedCollectionIsDisjointWith(other vocab.Type) bool {
} }
// OrderedCollectionIsExtendedBy returns true if the other provided type extends // OrderedCollectionIsExtendedBy returns true if the other provided type extends
// from the OrderedCollection type. // from the OrderedCollection type. Note that it returns false if the types
// are the same; see the "IsOrExtendsOrderedCollection" variant instead.
func OrderedCollectionIsExtendedBy(other vocab.Type) bool { func OrderedCollectionIsExtendedBy(other vocab.Type) bool {
extensions := []string{"OrderedCollectionPage"} extensions := []string{"OrderedCollectionPage"}
for _, ext := range extensions { for _, ext := range extensions {

ファイルの表示

@ -429,6 +429,15 @@ func DeserializeOrderedCollectionPage(m map[string]interface{}, aliasMap map[str
return this, nil return this, nil
} }
// IsOrExtendsOrderedCollectionPage returns true if the other provided type is the
// OrderedCollectionPage type or extends from the OrderedCollectionPage type.
func IsOrExtendsOrderedCollectionPage(other vocab.Type) bool {
if other.GetTypeName() == "OrderedCollectionPage" {
return true
}
return this.OrderedCollectionPageIsExtendedBy(other)
}
// NewActivityStreamsOrderedCollectionPage creates a new OrderedCollectionPage type // NewActivityStreamsOrderedCollectionPage creates a new OrderedCollectionPage type
func NewActivityStreamsOrderedCollectionPage() *ActivityStreamsOrderedCollectionPage { func NewActivityStreamsOrderedCollectionPage() *ActivityStreamsOrderedCollectionPage {
typeProp := typePropertyConstructor() typeProp := typePropertyConstructor()
@ -453,7 +462,9 @@ func OrderedCollectionPageIsDisjointWith(other vocab.Type) bool {
} }
// OrderedCollectionPageIsExtendedBy returns true if the other provided type // OrderedCollectionPageIsExtendedBy returns true if the other provided type
// extends from the OrderedCollectionPage type. // extends from the OrderedCollectionPage type. Note that it returns false if
// the types are the same; see the "IsOrExtendsOrderedCollectionPage" variant
// instead.
func OrderedCollectionPageIsExtendedBy(other vocab.Type) bool { func OrderedCollectionPageIsExtendedBy(other vocab.Type) bool {
// Shortcut implementation: is not extended by anything. // Shortcut implementation: is not extended by anything.
return false return false

ファイルの表示

@ -401,6 +401,15 @@ func DeserializeOrganization(m map[string]interface{}, aliasMap map[string]strin
return this, nil return this, nil
} }
// IsOrExtendsOrganization returns true if the other provided type is the
// Organization type or extends from the Organization type.
func IsOrExtendsOrganization(other vocab.Type) bool {
if other.GetTypeName() == "Organization" {
return true
}
return this.OrganizationIsExtendedBy(other)
}
// NewActivityStreamsOrganization creates a new Organization type // NewActivityStreamsOrganization creates a new Organization type
func NewActivityStreamsOrganization() *ActivityStreamsOrganization { func NewActivityStreamsOrganization() *ActivityStreamsOrganization {
typeProp := typePropertyConstructor() typeProp := typePropertyConstructor()
@ -425,7 +434,8 @@ func OrganizationIsDisjointWith(other vocab.Type) bool {
} }
// OrganizationIsExtendedBy returns true if the other provided type extends from // OrganizationIsExtendedBy returns true if the other provided type extends from
// the Organization type. // the Organization type. Note that it returns false if the types are the
// same; see the "IsOrExtendsOrganization" variant instead.
func OrganizationIsExtendedBy(other vocab.Type) bool { func OrganizationIsExtendedBy(other vocab.Type) bool {
// Shortcut implementation: is not extended by anything. // Shortcut implementation: is not extended by anything.
return false return false

ファイルの表示

@ -344,6 +344,15 @@ func DeserializePage(m map[string]interface{}, aliasMap map[string]string) (*Act
return this, nil return this, nil
} }
// IsOrExtendsPage returns true if the other provided type is the Page type or
// extends from the Page type.
func IsOrExtendsPage(other vocab.Type) bool {
if other.GetTypeName() == "Page" {
return true
}
return this.PageIsExtendedBy(other)
}
// NewActivityStreamsPage creates a new Page type // NewActivityStreamsPage creates a new Page type
func NewActivityStreamsPage() *ActivityStreamsPage { func NewActivityStreamsPage() *ActivityStreamsPage {
typeProp := typePropertyConstructor() typeProp := typePropertyConstructor()
@ -368,7 +377,8 @@ func PageIsDisjointWith(other vocab.Type) bool {
} }
// PageIsExtendedBy returns true if the other provided type extends from the Page // PageIsExtendedBy returns true if the other provided type extends from the Page
// type. // type. Note that it returns false if the types are the same; see the
// "IsOrExtendsPage" variant instead.
func PageIsExtendedBy(other vocab.Type) bool { func PageIsExtendedBy(other vocab.Type) bool {
// Shortcut implementation: is not extended by anything. // Shortcut implementation: is not extended by anything.
return false return false

ファイルの表示

@ -401,6 +401,15 @@ func DeserializePerson(m map[string]interface{}, aliasMap map[string]string) (*A
return this, nil return this, nil
} }
// IsOrExtendsPerson returns true if the other provided type is the Person type or
// extends from the Person type.
func IsOrExtendsPerson(other vocab.Type) bool {
if other.GetTypeName() == "Person" {
return true
}
return this.PersonIsExtendedBy(other)
}
// NewActivityStreamsPerson creates a new Person type // NewActivityStreamsPerson creates a new Person type
func NewActivityStreamsPerson() *ActivityStreamsPerson { func NewActivityStreamsPerson() *ActivityStreamsPerson {
typeProp := typePropertyConstructor() typeProp := typePropertyConstructor()
@ -425,7 +434,8 @@ func PersonIsDisjointWith(other vocab.Type) bool {
} }
// PersonIsExtendedBy returns true if the other provided type extends from the // PersonIsExtendedBy returns true if the other provided type extends from the
// Person type. // Person type. Note that it returns false if the types are the same; see the
// "IsOrExtendsPerson" variant instead.
func PersonIsExtendedBy(other vocab.Type) bool { func PersonIsExtendedBy(other vocab.Type) bool {
// Shortcut implementation: is not extended by anything. // Shortcut implementation: is not extended by anything.
return false return false

ファイルの表示

@ -394,6 +394,15 @@ func DeserializePlace(m map[string]interface{}, aliasMap map[string]string) (*Ac
return this, nil return this, nil
} }
// IsOrExtendsPlace returns true if the other provided type is the Place type or
// extends from the Place type.
func IsOrExtendsPlace(other vocab.Type) bool {
if other.GetTypeName() == "Place" {
return true
}
return this.PlaceIsExtendedBy(other)
}
// NewActivityStreamsPlace creates a new Place type // NewActivityStreamsPlace creates a new Place type
func NewActivityStreamsPlace() *ActivityStreamsPlace { func NewActivityStreamsPlace() *ActivityStreamsPlace {
typeProp := typePropertyConstructor() typeProp := typePropertyConstructor()
@ -418,7 +427,8 @@ func PlaceIsDisjointWith(other vocab.Type) bool {
} }
// PlaceIsExtendedBy returns true if the other provided type extends from the // PlaceIsExtendedBy returns true if the other provided type extends from the
// Place type. // Place type. Note that it returns false if the types are the same; see the
// "IsOrExtendsPlace" variant instead.
func PlaceIsExtendedBy(other vocab.Type) bool { func PlaceIsExtendedBy(other vocab.Type) bool {
// Shortcut implementation: is not extended by anything. // Shortcut implementation: is not extended by anything.
return false return false

ファイルの表示

@ -357,6 +357,15 @@ func DeserializeProfile(m map[string]interface{}, aliasMap map[string]string) (*
return this, nil return this, nil
} }
// IsOrExtendsProfile returns true if the other provided type is the Profile type
// or extends from the Profile type.
func IsOrExtendsProfile(other vocab.Type) bool {
if other.GetTypeName() == "Profile" {
return true
}
return this.ProfileIsExtendedBy(other)
}
// NewActivityStreamsProfile creates a new Profile type // NewActivityStreamsProfile creates a new Profile type
func NewActivityStreamsProfile() *ActivityStreamsProfile { func NewActivityStreamsProfile() *ActivityStreamsProfile {
typeProp := typePropertyConstructor() typeProp := typePropertyConstructor()
@ -381,7 +390,8 @@ func ProfileIsDisjointWith(other vocab.Type) bool {
} }
// ProfileIsExtendedBy returns true if the other provided type extends from the // ProfileIsExtendedBy returns true if the other provided type extends from the
// Profile type. // Profile type. Note that it returns false if the types are the same; see the
// "IsOrExtendsProfile" variant instead.
func ProfileIsExtendedBy(other vocab.Type) bool { func ProfileIsExtendedBy(other vocab.Type) bool {
// Shortcut implementation: is not extended by anything. // Shortcut implementation: is not extended by anything.
return false return false

ファイルの表示

@ -421,6 +421,15 @@ func DeserializeQuestion(m map[string]interface{}, aliasMap map[string]string) (
return this, nil return this, nil
} }
// IsOrExtendsQuestion returns true if the other provided type is the Question
// type or extends from the Question type.
func IsOrExtendsQuestion(other vocab.Type) bool {
if other.GetTypeName() == "Question" {
return true
}
return this.QuestionIsExtendedBy(other)
}
// NewActivityStreamsQuestion creates a new Question type // NewActivityStreamsQuestion creates a new Question type
func NewActivityStreamsQuestion() *ActivityStreamsQuestion { func NewActivityStreamsQuestion() *ActivityStreamsQuestion {
typeProp := typePropertyConstructor() typeProp := typePropertyConstructor()
@ -445,7 +454,8 @@ func QuestionIsDisjointWith(other vocab.Type) bool {
} }
// QuestionIsExtendedBy returns true if the other provided type extends from the // QuestionIsExtendedBy returns true if the other provided type extends from the
// Question type. // Question type. Note that it returns false if the types are the same; see
// the "IsOrExtendsQuestion" variant instead.
func QuestionIsExtendedBy(other vocab.Type) bool { func QuestionIsExtendedBy(other vocab.Type) bool {
// Shortcut implementation: is not extended by anything. // Shortcut implementation: is not extended by anything.
return false return false

ファイルの表示

@ -388,6 +388,15 @@ func DeserializeRead(m map[string]interface{}, aliasMap map[string]string) (*Act
return this, nil return this, nil
} }
// IsOrExtendsRead returns true if the other provided type is the Read type or
// extends from the Read type.
func IsOrExtendsRead(other vocab.Type) bool {
if other.GetTypeName() == "Read" {
return true
}
return this.ReadIsExtendedBy(other)
}
// NewActivityStreamsRead creates a new Read type // NewActivityStreamsRead creates a new Read type
func NewActivityStreamsRead() *ActivityStreamsRead { func NewActivityStreamsRead() *ActivityStreamsRead {
typeProp := typePropertyConstructor() typeProp := typePropertyConstructor()
@ -412,7 +421,8 @@ func ReadIsDisjointWith(other vocab.Type) bool {
} }
// ReadIsExtendedBy returns true if the other provided type extends from the Read // ReadIsExtendedBy returns true if the other provided type extends from the Read
// type. // type. Note that it returns false if the types are the same; see the
// "IsOrExtendsRead" variant instead.
func ReadIsExtendedBy(other vocab.Type) bool { func ReadIsExtendedBy(other vocab.Type) bool {
// Shortcut implementation: is not extended by anything. // Shortcut implementation: is not extended by anything.
return false return false

ファイルの表示

@ -396,6 +396,15 @@ func DeserializeReject(m map[string]interface{}, aliasMap map[string]string) (*A
return this, nil return this, nil
} }
// IsOrExtendsReject returns true if the other provided type is the Reject type or
// extends from the Reject type.
func IsOrExtendsReject(other vocab.Type) bool {
if other.GetTypeName() == "Reject" {
return true
}
return this.RejectIsExtendedBy(other)
}
// NewActivityStreamsReject creates a new Reject type // NewActivityStreamsReject creates a new Reject type
func NewActivityStreamsReject() *ActivityStreamsReject { func NewActivityStreamsReject() *ActivityStreamsReject {
typeProp := typePropertyConstructor() typeProp := typePropertyConstructor()
@ -420,7 +429,8 @@ func RejectIsDisjointWith(other vocab.Type) bool {
} }
// RejectIsExtendedBy returns true if the other provided type extends from the // RejectIsExtendedBy returns true if the other provided type extends from the
// Reject type. // Reject type. Note that it returns false if the types are the same; see the
// "IsOrExtendsReject" variant instead.
func RejectIsExtendedBy(other vocab.Type) bool { func RejectIsExtendedBy(other vocab.Type) bool {
extensions := []string{"TentativeReject"} extensions := []string{"TentativeReject"}
for _, ext := range extensions { for _, ext := range extensions {

ファイルの表示

@ -370,6 +370,15 @@ func DeserializeRelationship(m map[string]interface{}, aliasMap map[string]strin
return this, nil return this, nil
} }
// IsOrExtendsRelationship returns true if the other provided type is the
// Relationship type or extends from the Relationship type.
func IsOrExtendsRelationship(other vocab.Type) bool {
if other.GetTypeName() == "Relationship" {
return true
}
return this.RelationshipIsExtendedBy(other)
}
// NewActivityStreamsRelationship creates a new Relationship type // NewActivityStreamsRelationship creates a new Relationship type
func NewActivityStreamsRelationship() *ActivityStreamsRelationship { func NewActivityStreamsRelationship() *ActivityStreamsRelationship {
typeProp := typePropertyConstructor() typeProp := typePropertyConstructor()
@ -394,7 +403,8 @@ func RelationshipIsDisjointWith(other vocab.Type) bool {
} }
// RelationshipIsExtendedBy returns true if the other provided type extends from // RelationshipIsExtendedBy returns true if the other provided type extends from
// the Relationship type. // the Relationship type. Note that it returns false if the types are the
// same; see the "IsOrExtendsRelationship" variant instead.
func RelationshipIsExtendedBy(other vocab.Type) bool { func RelationshipIsExtendedBy(other vocab.Type) bool {
// Shortcut implementation: is not extended by anything. // Shortcut implementation: is not extended by anything.
return false return false

ファイルの表示

@ -411,6 +411,15 @@ func DeserializeRemove(m map[string]interface{}, aliasMap map[string]string) (*A
return this, nil return this, nil
} }
// IsOrExtendsRemove returns true if the other provided type is the Remove type or
// extends from the Remove type.
func IsOrExtendsRemove(other vocab.Type) bool {
if other.GetTypeName() == "Remove" {
return true
}
return this.RemoveIsExtendedBy(other)
}
// NewActivityStreamsRemove creates a new Remove type // NewActivityStreamsRemove creates a new Remove type
func NewActivityStreamsRemove() *ActivityStreamsRemove { func NewActivityStreamsRemove() *ActivityStreamsRemove {
typeProp := typePropertyConstructor() typeProp := typePropertyConstructor()
@ -435,7 +444,8 @@ func RemoveIsDisjointWith(other vocab.Type) bool {
} }
// RemoveIsExtendedBy returns true if the other provided type extends from the // RemoveIsExtendedBy returns true if the other provided type extends from the
// Remove type. // Remove type. Note that it returns false if the types are the same; see the
// "IsOrExtendsRemove" variant instead.
func RemoveIsExtendedBy(other vocab.Type) bool { func RemoveIsExtendedBy(other vocab.Type) bool {
// Shortcut implementation: is not extended by anything. // Shortcut implementation: is not extended by anything.
return false return false

ファイルの表示

@ -401,6 +401,15 @@ func DeserializeService(m map[string]interface{}, aliasMap map[string]string) (*
return this, nil return this, nil
} }
// IsOrExtendsService returns true if the other provided type is the Service type
// or extends from the Service type.
func IsOrExtendsService(other vocab.Type) bool {
if other.GetTypeName() == "Service" {
return true
}
return this.ServiceIsExtendedBy(other)
}
// NewActivityStreamsService creates a new Service type // NewActivityStreamsService creates a new Service type
func NewActivityStreamsService() *ActivityStreamsService { func NewActivityStreamsService() *ActivityStreamsService {
typeProp := typePropertyConstructor() typeProp := typePropertyConstructor()
@ -425,7 +434,8 @@ func ServiceIsDisjointWith(other vocab.Type) bool {
} }
// ServiceIsExtendedBy returns true if the other provided type extends from the // ServiceIsExtendedBy returns true if the other provided type extends from the
// Service type. // Service type. Note that it returns false if the types are the same; see the
// "IsOrExtendsService" variant instead.
func ServiceIsExtendedBy(other vocab.Type) bool { func ServiceIsExtendedBy(other vocab.Type) bool {
// Shortcut implementation: is not extended by anything. // Shortcut implementation: is not extended by anything.
return false return false

ファイルの表示

@ -395,6 +395,15 @@ func DeserializeTentativeAccept(m map[string]interface{}, aliasMap map[string]st
return this, nil return this, nil
} }
// IsOrExtendsTentativeAccept returns true if the other provided type is the
// TentativeAccept type or extends from the TentativeAccept type.
func IsOrExtendsTentativeAccept(other vocab.Type) bool {
if other.GetTypeName() == "TentativeAccept" {
return true
}
return this.TentativeAcceptIsExtendedBy(other)
}
// NewActivityStreamsTentativeAccept creates a new TentativeAccept type // NewActivityStreamsTentativeAccept creates a new TentativeAccept type
func NewActivityStreamsTentativeAccept() *ActivityStreamsTentativeAccept { func NewActivityStreamsTentativeAccept() *ActivityStreamsTentativeAccept {
typeProp := typePropertyConstructor() typeProp := typePropertyConstructor()
@ -419,7 +428,8 @@ func TentativeAcceptIsDisjointWith(other vocab.Type) bool {
} }
// TentativeAcceptIsExtendedBy returns true if the other provided type extends // TentativeAcceptIsExtendedBy returns true if the other provided type extends
// from the TentativeAccept type. // from the TentativeAccept type. Note that it returns false if the types are
// the same; see the "IsOrExtendsTentativeAccept" variant instead.
func TentativeAcceptIsExtendedBy(other vocab.Type) bool { func TentativeAcceptIsExtendedBy(other vocab.Type) bool {
// Shortcut implementation: is not extended by anything. // Shortcut implementation: is not extended by anything.
return false return false

ファイルの表示

@ -395,6 +395,15 @@ func DeserializeTentativeReject(m map[string]interface{}, aliasMap map[string]st
return this, nil return this, nil
} }
// IsOrExtendsTentativeReject returns true if the other provided type is the
// TentativeReject type or extends from the TentativeReject type.
func IsOrExtendsTentativeReject(other vocab.Type) bool {
if other.GetTypeName() == "TentativeReject" {
return true
}
return this.TentativeRejectIsExtendedBy(other)
}
// NewActivityStreamsTentativeReject creates a new TentativeReject type // NewActivityStreamsTentativeReject creates a new TentativeReject type
func NewActivityStreamsTentativeReject() *ActivityStreamsTentativeReject { func NewActivityStreamsTentativeReject() *ActivityStreamsTentativeReject {
typeProp := typePropertyConstructor() typeProp := typePropertyConstructor()
@ -419,7 +428,8 @@ func TentativeRejectIsDisjointWith(other vocab.Type) bool {
} }
// TentativeRejectIsExtendedBy returns true if the other provided type extends // TentativeRejectIsExtendedBy returns true if the other provided type extends
// from the TentativeReject type. // from the TentativeReject type. Note that it returns false if the types are
// the same; see the "IsOrExtendsTentativeReject" variant instead.
func TentativeRejectIsExtendedBy(other vocab.Type) bool { func TentativeRejectIsExtendedBy(other vocab.Type) bool {
// Shortcut implementation: is not extended by anything. // Shortcut implementation: is not extended by anything.
return false return false

ファイルの表示

@ -378,6 +378,15 @@ func DeserializeTombstone(m map[string]interface{}, aliasMap map[string]string)
return this, nil return this, nil
} }
// IsOrExtendsTombstone returns true if the other provided type is the Tombstone
// type or extends from the Tombstone type.
func IsOrExtendsTombstone(other vocab.Type) bool {
if other.GetTypeName() == "Tombstone" {
return true
}
return this.TombstoneIsExtendedBy(other)
}
// NewActivityStreamsTombstone creates a new Tombstone type // NewActivityStreamsTombstone creates a new Tombstone type
func NewActivityStreamsTombstone() *ActivityStreamsTombstone { func NewActivityStreamsTombstone() *ActivityStreamsTombstone {
typeProp := typePropertyConstructor() typeProp := typePropertyConstructor()
@ -402,7 +411,8 @@ func TombstoneIsDisjointWith(other vocab.Type) bool {
} }
// TombstoneIsExtendedBy returns true if the other provided type extends from the // TombstoneIsExtendedBy returns true if the other provided type extends from the
// Tombstone type. // Tombstone type. Note that it returns false if the types are the same; see
// the "IsOrExtendsTombstone" variant instead.
func TombstoneIsExtendedBy(other vocab.Type) bool { func TombstoneIsExtendedBy(other vocab.Type) bool {
// Shortcut implementation: is not extended by anything. // Shortcut implementation: is not extended by anything.
return false return false

ファイルの表示

@ -389,6 +389,15 @@ func DeserializeTravel(m map[string]interface{}, aliasMap map[string]string) (*A
return this, nil return this, nil
} }
// IsOrExtendsTravel returns true if the other provided type is the Travel type or
// extends from the Travel type.
func IsOrExtendsTravel(other vocab.Type) bool {
if other.GetTypeName() == "Travel" {
return true
}
return this.TravelIsExtendedBy(other)
}
// NewActivityStreamsTravel creates a new Travel type // NewActivityStreamsTravel creates a new Travel type
func NewActivityStreamsTravel() *ActivityStreamsTravel { func NewActivityStreamsTravel() *ActivityStreamsTravel {
typeProp := typePropertyConstructor() typeProp := typePropertyConstructor()
@ -413,7 +422,8 @@ func TravelIsDisjointWith(other vocab.Type) bool {
} }
// TravelIsExtendedBy returns true if the other provided type extends from the // TravelIsExtendedBy returns true if the other provided type extends from the
// Travel type. // Travel type. Note that it returns false if the types are the same; see the
// "IsOrExtendsTravel" variant instead.
func TravelIsExtendedBy(other vocab.Type) bool { func TravelIsExtendedBy(other vocab.Type) bool {
// Shortcut implementation: is not extended by anything. // Shortcut implementation: is not extended by anything.
return false return false

ファイルの表示

@ -394,6 +394,15 @@ func DeserializeUndo(m map[string]interface{}, aliasMap map[string]string) (*Act
return this, nil return this, nil
} }
// IsOrExtendsUndo returns true if the other provided type is the Undo type or
// extends from the Undo type.
func IsOrExtendsUndo(other vocab.Type) bool {
if other.GetTypeName() == "Undo" {
return true
}
return this.UndoIsExtendedBy(other)
}
// NewActivityStreamsUndo creates a new Undo type // NewActivityStreamsUndo creates a new Undo type
func NewActivityStreamsUndo() *ActivityStreamsUndo { func NewActivityStreamsUndo() *ActivityStreamsUndo {
typeProp := typePropertyConstructor() typeProp := typePropertyConstructor()
@ -418,7 +427,8 @@ func UndoIsDisjointWith(other vocab.Type) bool {
} }
// UndoIsExtendedBy returns true if the other provided type extends from the Undo // UndoIsExtendedBy returns true if the other provided type extends from the Undo
// type. // type. Note that it returns false if the types are the same; see the
// "IsOrExtendsUndo" variant instead.
func UndoIsExtendedBy(other vocab.Type) bool { func UndoIsExtendedBy(other vocab.Type) bool {
// Shortcut implementation: is not extended by anything. // Shortcut implementation: is not extended by anything.
return false return false

ファイルの表示

@ -391,6 +391,15 @@ func DeserializeUpdate(m map[string]interface{}, aliasMap map[string]string) (*A
return this, nil return this, nil
} }
// IsOrExtendsUpdate returns true if the other provided type is the Update type or
// extends from the Update type.
func IsOrExtendsUpdate(other vocab.Type) bool {
if other.GetTypeName() == "Update" {
return true
}
return this.UpdateIsExtendedBy(other)
}
// NewActivityStreamsUpdate creates a new Update type // NewActivityStreamsUpdate creates a new Update type
func NewActivityStreamsUpdate() *ActivityStreamsUpdate { func NewActivityStreamsUpdate() *ActivityStreamsUpdate {
typeProp := typePropertyConstructor() typeProp := typePropertyConstructor()
@ -415,7 +424,8 @@ func UpdateIsDisjointWith(other vocab.Type) bool {
} }
// UpdateIsExtendedBy returns true if the other provided type extends from the // UpdateIsExtendedBy returns true if the other provided type extends from the
// Update type. // Update type. Note that it returns false if the types are the same; see the
// "IsOrExtendsUpdate" variant instead.
func UpdateIsExtendedBy(other vocab.Type) bool { func UpdateIsExtendedBy(other vocab.Type) bool {
// Shortcut implementation: is not extended by anything. // Shortcut implementation: is not extended by anything.
return false return false

ファイルの表示

@ -345,6 +345,15 @@ func DeserializeVideo(m map[string]interface{}, aliasMap map[string]string) (*Ac
return this, nil return this, nil
} }
// IsOrExtendsVideo returns true if the other provided type is the Video type or
// extends from the Video type.
func IsOrExtendsVideo(other vocab.Type) bool {
if other.GetTypeName() == "Video" {
return true
}
return this.VideoIsExtendedBy(other)
}
// NewActivityStreamsVideo creates a new Video type // NewActivityStreamsVideo creates a new Video type
func NewActivityStreamsVideo() *ActivityStreamsVideo { func NewActivityStreamsVideo() *ActivityStreamsVideo {
typeProp := typePropertyConstructor() typeProp := typePropertyConstructor()
@ -369,7 +378,8 @@ func VideoIsDisjointWith(other vocab.Type) bool {
} }
// VideoIsExtendedBy returns true if the other provided type extends from the // VideoIsExtendedBy returns true if the other provided type extends from the
// Video type. // Video type. Note that it returns false if the types are the same; see the
// "IsOrExtendsVideo" variant instead.
func VideoIsExtendedBy(other vocab.Type) bool { func VideoIsExtendedBy(other vocab.Type) bool {
// Shortcut implementation: is not extended by anything. // Shortcut implementation: is not extended by anything.
return false return false

ファイルの表示

@ -391,6 +391,15 @@ func DeserializeView(m map[string]interface{}, aliasMap map[string]string) (*Act
return this, nil return this, nil
} }
// IsOrExtendsView returns true if the other provided type is the View type or
// extends from the View type.
func IsOrExtendsView(other vocab.Type) bool {
if other.GetTypeName() == "View" {
return true
}
return this.ViewIsExtendedBy(other)
}
// NewActivityStreamsView creates a new View type // NewActivityStreamsView creates a new View type
func NewActivityStreamsView() *ActivityStreamsView { func NewActivityStreamsView() *ActivityStreamsView {
typeProp := typePropertyConstructor() typeProp := typePropertyConstructor()
@ -415,7 +424,8 @@ func ViewIsDisjointWith(other vocab.Type) bool {
} }
// ViewIsExtendedBy returns true if the other provided type extends from the View // ViewIsExtendedBy returns true if the other provided type extends from the View
// type. // type. Note that it returns false if the types are the same; see the
// "IsOrExtendsView" variant instead.
func ViewIsExtendedBy(other vocab.Type) bool { func ViewIsExtendedBy(other vocab.Type) bool {
// Shortcut implementation: is not extended by anything. // Shortcut implementation: is not extended by anything.
return false return false