func (this *ActivityStreamsWidthProperty) SetIRI(v *url.URL) {
	this.Clear()
	this.iri = v
}
SetIRI sets the value of this property. Calling IsIRI afterwards will return
true.
package propertywidth
import (
	"fmt"
	nonnegativeinteger "github.com/go-fed/activity/streams/values/nonNegativeInteger"
	vocab "github.com/go-fed/activity/streams/vocab"
	"net/url"
)
type ActivityStreamsWidthProperty struct {
	xmlschemaNonNegativeIntegerMember int
	hasNonNegativeIntegerMember       bool
	unknown                           interface{}
	iri                               *url.URL
	alias                             string
}
func DeserializeWidthProperty(m map[string]interface{}, aliasMap map[string]string) (*ActivityStreamsWidthProperty, error) {
	alias := ""
	if a, ok := aliasMap["https://www.w3.org/ns/activitystreams"]; ok {
		alias = a
	}
	propName := "width"
	if len(alias) > 0 {
		propName = fmt.Sprintf("%s:%s", alias, "width")
	}
	i, ok := m[propName]
	if ok {
		if s, ok := i.(string); ok {
			u, err := url.Parse(s)
			if err == nil && len(u.Scheme) > 0 {
				this := &ActivityStreamsWidthProperty{
					alias: alias,
					iri:   u,
				}
				return this, nil
			}
		}
		if v, err := nonnegativeinteger.DeserializeNonNegativeInteger(i); err == nil {
			this := &ActivityStreamsWidthProperty{
				alias:                             alias,
				hasNonNegativeIntegerMember:       true,
				xmlschemaNonNegativeIntegerMember: v,
			}
			return this, nil
		}
		this := &ActivityStreamsWidthProperty{
			alias:   alias,
			unknown: i,
		}
		return this, nil
	}
	return nil, nil
}
func NewActivityStreamsWidthProperty() *ActivityStreamsWidthProperty {
	return &ActivityStreamsWidthProperty{alias: ""}
}
func (this *ActivityStreamsWidthProperty) Clear() {
	this.unknown = nil
	this.iri = nil
	this.hasNonNegativeIntegerMember = false
}
func (this ActivityStreamsWidthProperty) Get() int {
	return this.xmlschemaNonNegativeIntegerMember
}
func (this ActivityStreamsWidthProperty) GetIRI() *url.URL {
	return this.iri
}
func (this ActivityStreamsWidthProperty) HasAny() bool {
	return this.IsXMLSchemaNonNegativeInteger() || this.iri != nil
}
func (this ActivityStreamsWidthProperty) IsIRI() bool {
	return this.iri != nil
}
func (this ActivityStreamsWidthProperty) IsXMLSchemaNonNegativeInteger() bool {
	return this.hasNonNegativeIntegerMember
}
func (this ActivityStreamsWidthProperty) JSONLDContext() map[string]string {
	m := map[string]string{"https://www.w3.org/ns/activitystreams": this.alias}
	var child map[string]string
	for k, v := range child {
		m[k] = v
	}
	return m
}
func (this ActivityStreamsWidthProperty) KindIndex() int {
	if this.IsXMLSchemaNonNegativeInteger() {
		return 0
	}
	if this.IsIRI() {
		return -2
	}
	return -1
}
func (this ActivityStreamsWidthProperty) LessThan(o vocab.ActivityStreamsWidthProperty) bool {
	if this.IsIRI() && o.IsIRI() {
		return this.iri.String() < o.GetIRI().String()
	} else if this.IsIRI() {
		return true
	} else if o.IsIRI() {
		return false
	}
	if !this.IsXMLSchemaNonNegativeInteger() && !o.IsXMLSchemaNonNegativeInteger() {
		return false
	} else if this.IsXMLSchemaNonNegativeInteger() && !o.IsXMLSchemaNonNegativeInteger() {
		return false
	} else if !this.IsXMLSchemaNonNegativeInteger() && o.IsXMLSchemaNonNegativeInteger() {
		return true
	} else {
		return nonnegativeinteger.LessNonNegativeInteger(this.Get(), o.Get())
	}
}
func (this ActivityStreamsWidthProperty) Name() string {
	if len(this.alias) > 0 {
		return this.alias + ":" + "width"
	} else {
		return "width"
	}
}
func (this ActivityStreamsWidthProperty) Serialize() (interface{}, error) {
	if this.IsXMLSchemaNonNegativeInteger() {
		return nonnegativeinteger.SerializeNonNegativeInteger(this.Get())
	} else if this.IsIRI() {
		return this.iri.String(), nil
	}
	return this.unknown, nil
}
func (this *ActivityStreamsWidthProperty) Set(v int) {
	this.Clear()
	this.xmlschemaNonNegativeIntegerMember = v
	this.hasNonNegativeIntegerMember = true
}