ToString function takes an Attribute object and converts it into a string.
(attribute *base.Attribute)
| 132 | |
| 133 | // ToString function takes an Attribute object and converts it into a string. |
| 134 | func ToString(attribute *base.Attribute) string { |
| 135 | // Get the entity from the attribute |
| 136 | entity := attribute.GetEntity() |
| 137 | |
| 138 | // Convert the entity to string |
| 139 | strEntity := EntityToString(entity) |
| 140 | |
| 141 | // Create the string representation of the attribute |
| 142 | result := fmt.Sprintf("%s$%s|%s:%s", strEntity, attribute.GetAttribute(), TypeUrlToString(attribute.GetValue().GetTypeUrl()), AnyToString(attribute.GetValue())) |
| 143 | |
| 144 | return result |
| 145 | } |
| 146 | |
| 147 | // EntityAndAttributeToString converts an entity and attribute to a single string. |
| 148 | func EntityAndAttributeToString(entity *base.Entity, attr string) string { |
no test coverage detected