empty_element.go 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. Copyright 2017 The Kubernetes Authors.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. package apply
  14. // EmptyElement is a placeholder for when no value is set for a field so its type is unknown
  15. type EmptyElement struct {
  16. // FieldMetaImpl contains metadata about the field from openapi
  17. FieldMetaImpl
  18. }
  19. // Merge implements Element.Merge
  20. func (e EmptyElement) Merge(v Strategy) (Result, error) {
  21. return v.MergeEmpty(e)
  22. }
  23. // IsAdd implements Element.IsAdd
  24. func (e EmptyElement) IsAdd() bool {
  25. return false
  26. }
  27. // IsDelete implements Element.IsDelete
  28. func (e EmptyElement) IsDelete() bool {
  29. return false
  30. }
  31. // GetRecorded implements Element.GetRecorded
  32. func (e EmptyElement) GetRecorded() interface{} {
  33. return nil
  34. }
  35. // GetLocal implements Element.GetLocal
  36. func (e EmptyElement) GetLocal() interface{} {
  37. return nil
  38. }
  39. // GetRemote implements Element.GetRemote
  40. func (e EmptyElement) GetRemote() interface{} {
  41. return nil
  42. }
  43. // HasRecorded implements Element.HasRecorded
  44. func (e EmptyElement) HasRecorded() bool {
  45. return false
  46. }
  47. // HasLocal implements Element.HasLocal
  48. func (e EmptyElement) HasLocal() bool {
  49. return false
  50. }
  51. // HasRemote implements Element.IsAdd
  52. func (e EmptyElement) HasRemote() bool {
  53. return false
  54. }
  55. var _ Element = &EmptyElement{}