Class Affinity.Builder

  • All Implemented Interfaces:
    software.amazon.jsii.Builder<Affinity>
    Enclosing interface:
    Affinity

    @Stability(Stable)
    public static final class Affinity.Builder
    extends Object
    implements software.amazon.jsii.Builder<Affinity>
    A builder for Affinity
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • podAffinity

        @Stability(Stable)
        public Affinity.Builder podAffinity​(PodAffinity podAffinity)
        Sets the value of Affinity.getPodAffinity()
        Parameters:
        podAffinity - Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)).
        Returns:
        this
      • podAntiAffinity

        @Stability(Stable)
        public Affinity.Builder podAntiAffinity​(PodAntiAffinity podAntiAffinity)
        Parameters:
        podAntiAffinity - Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)).
        Returns:
        this
      • build

        @Stability(Stable)
        public Affinity build()
        Builds the configured instance.
        Specified by:
        build in interface software.amazon.jsii.Builder<Affinity>
        Returns:
        a new instance of Affinity
        Throws:
        NullPointerException - if any required attribute was not provided